Pushing inode limit

Permalink
My inode meter on cPanel is constantly red and near full (300,000) I have tried a number of things to reduce it and clean out fairly regularly or when it causes issues. Many unnecessary folders seem to have been created under Files in each of my installs. Each branch could contain one or two images, or none. Is there an easy/best way to clean these out? and stop it happening when uploading images?

1 Attachment

 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Your inode limit could be affected by other factors rather than just images, for example, accumulated dross in your database can be a factor..
What version of C5 are you running?
JohntheFish replied on at Permalink Reply
JohntheFish
can you provide some info about the site. URL, c5 core version etc.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Yeah, I already asked which C5 Version. He's based in Australia so a bit of a time difference.
mesuva replied on at Permalink Reply
mesuva
The folder structure created under files directory is intentional and I'd advise against touching it - it's directly tied to the files in your file manager.

But unless you have a ludicrous number of files in your file manager, it's unlikely to be the cause of your inode limit being reached.

I think nearly every time I've seen this is when temporary session files aren't being automatically cleaned up (often called 'garbage collection'), and these grow in number over time.

When this has happened it's been because the PHP install hasn't been configured correctly/completely. Turning the garbage collection on either at the master config level, or an account level with some settings like these in an .htaccess file have worked for me:
php_value session.gc_divisor 100
php_value session.gc_probability 1

Adding these in and visiting the site a few times kicks this process off and the number of session files drops back down to a normal level.

Besides that suggestion sometimes the cache folder can get very large, but I don't ever recall hitting inode limits because of it.

Also note that the inode count in cPanel isn't going to update immediately, I believe there's a nightly script that runs to update that count.