Reducing the number of inodes

Relax and enjoy The Lounge. For all Non-Joomla! topics or ones that don't fit anywhere else. Normal forum rules apply.
Post Reply
User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 10893
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Reducing the number of inodes

Post by sozzled » Wed Sep 15, 2021 9:01 pm

One issue for users of commercially-hosted website platforms relates to staying within the limits of how much "space" your files consume on the webhost. The total disk usage is only one possible limit (even if the webhost says that your account has "unlimited" disk quota).

In my case, I have "unlimited" disk quota but there is a limit on the number of inodes that the files consume. The number of inodes has some correlation with the number of files that you've uploaded to a server; the more files you have stored the more inodes are used.

There are a lot of files that are unnecessary for a J! installation; these files may have been deposited over time (depending on how long you have been running J! for your websites) and can probably be removed. One such file is named index.html. These days, J! doesn't normally deposit these files when you create new websites; some extensions (especially extensions written years ago) may create such files but they don't actually serve any practical purpose.

One way to reduce the number of inodes is to remove unnecessary files from the file system. I'm not saying that it will reduce a significant amount of inodes if you remove a couple of hundred files but, if you have several websites hosted on the server, these can add up to tens of thousands of files over time. Typically, these files are very small (less than 100 bytes), but it's not the size of the files I'm talking about: it's the number of them.

I've begun a process of deleting any file named index.html from the server where my websites are hosted. So far, I have reduced the number of inodes by a small amount (less than 0.5% for each website); it also takes a long time to search for all of them (a couple of hours or more), so it's a long process. Little by little, however, I'm reducing the number of inodes. I mention this because it may be useful to some people. :)

Also, so far, I haven't encountered any loss in functionality in J! by removing these files.
Last edited by sozzled on Wed Sep 15, 2021 9:41 pm, edited 1 time in total.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12231
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Reducing the number of inodes

Post by brian » Wed Sep 15, 2021 9:12 pm

and they will all come back when you update those extensions.

If your hosting provider is so restrictive on inodes its time to get a new host. Time costs money
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 10893
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Reducing the number of inodes

Post by sozzled » Wed Sep 15, 2021 9:18 pm

Thanks, @brian and, yeah, I understand. Fortunately, most of my websites don't have too many of those extensions that ship with index.html. I'm also getting rid of these files in those extensions I've written. I guess that some older extensions (that never used the Joomla update notifier) will have those files littering the installation package.

It's also should be borne in mind that we need to be careful about installing extensions that were written when shipping index.html files seemed like a "good idea" at the time. It's good to know that the J! CMS has not been doing this since I-can't-remember-when (but probably in the last half-a-decade or so). Older versions of the J! CMS (i.e. J! 2.5 and before) certainly did. :laugh:

There are also other places where unnecessary files accumulate over time: the /tmp folder is one of them. Some third-party templates are notorious for filling your file system with "cached" files created whenever it seems like it's a good opportunity to create them (but don't delete old files as part of the process); this is one reason why I carefull select which template framework I'm considering deploying on my websites. Some template frameworks install a lot of bloat—or "overkill"—which is unnecessary for constructing most websites; but, then again, some website owners may use some of the extra functionality built into those template frameworks. Some template frameworks look super cool on the outside but underneath the hood there's a helluva lot that makes you wonder why they were designed like that!

While I could increase my webhosting plan to "the next level", the next level up (which allows for a 50% increase in inode quota) is another $250 spread over three years. It's not really worth the benefit in spending hundreds of dollars to run my "hobby farm". :)
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 10893
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Reducing the number of inodes

Post by sozzled » Thu Sep 16, 2021 8:28 pm

I removed all the index.html files from my websites—about 4,000 files—and further gained a reduction of more than 6% inode consumption by deleting all files located in any /tmp folders (about another 50,000 files)! The total number of inodes being consumed fell by more than 6%. It just goes to show how easily litter accumulates over time, doesn't it?
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)


Post Reply

Return to “The Lounge”