Reducing Inodes In Shared Hosting Environments

When it comes to using shared hosting accounts such as Bluehost, SiteGround, or GoDaddy there’s more to watch out for than just your bandwidth (amount of visitors visiting your website per hour) and server space.  There’s a concept called inodes.  I like to think of inode as a way for linux systems to measure disk space.  So the number of files, folders, and the size of the files adds up to the inode count.  Most people will not reach their inode count unless they start having large websites filled with huge file size media, host multiple websites under a single account, or have a lot of emails (especially true if your domain email comes free with a hosting account).

So with that in mind, if you’re reaching your inode count for your account, here are some ways to reduce the inode count.  Before proceeding, make a backup of your server.  You could use the host’s backup feature if it has one or manually backup your account via FTP and PHPMyAdmin for the database.

  • Remove unnecessary websites.  If you have old legacy websites that are no longer being used, connected to a domain or add-on domain, you may want to consider removing them to free up your inode count.  If you have setup a staging website and no longer need it, you may want to remove that as well.
  • Remove unneeded databases or tables.  Similar to the point above, you may have unused databases for legacy sites that you removed.  This is especially true, if you removed a WordPress website.  Sometimes the host’s uninstaller doesn’t delete the database automatically.  So you’ll need to check-in PHPMyAdmin or a database tool to see if the database is deleted.  Prior to deleting the WordPress website, you may want to note what the database name is in wp-config so you can check for it later.
  • To my point above, check to see if the FTP account for the website and/or unused FTP accounts and delete those.
  • When uninstalling plugins.  Some plugins don’t clean up the database and will leave data in your database tables.  You can run WP-Optimize and have it scan for unneeded tables and clear them out.  That should free up your database which also lowers your inode count.  Run this for every website you have under your account.
  • In addition, WP-Optimize also has the ability to compress your images in a way that does not affect quality.  By reducing your overall image file size, you’re not only freeing up disk space and lowering the inode count, but you’re also making your website load faster, which is good for SEO and website usability.  Another image compression program for WordPress that I like to use is EWWW Image Optimizer.  If your website isn’t a WordPress website, then I would recommend running all your images through ImageOptim (if you have a Mac) or go here to see other File Image Compression programs alternatives.
  • If you are hosting multiple WordPress websites, you’re adding a ton of files for each WordPress installs you have.  You’re looking at 5,000 files and about 1GB per website!  Going WordPress MU (WordPress Multisite Network Environment),  you’re using 1 WordPress install to host all your WordPress websites.  You’ll also be able to then share plugins and themes across the environment.  Obviously, this is a personal choice to do so since putting all your website eggs in one basket does have their own pitfalls, but as far as reducing massive amounts of inodes, this is a lead contender if you have a handful of WordPress websites.
  • Removing unnecessary large files, unused WordPress plugins (especially Hello Dolly that comes default with WordPress), and WordPress themes will help lower inode count.  If you remove files for a WordPress website, remove them via the Media tab.  That will also clean up the database automatically and delete all the various image sizes that WordPress generates for a single image.  You could try Media Cleaner, which is a plugin that autodetects unused images on your website.  I have not used this one personally, but like always, make a good backup before using everything I mention.  I assume this works by looking at the database to see which images are NOT associated to a page or post and deletes them.  So this would not work well if you hot-link/hard-code images (embedding the image via URL in the code rather than using the “add media” button) or need the images from outside the website.
  • If you use any plugins to backup files (such as BackupBuddy) remove some really old backups as they do take up space.  Depending on how large your website is, each backup can be half a gig each!
  • Check and reanalyze any pinging uptime robot if possible.  These pings to your website would cause your server to process requests and eat into your inodes.  If you have pings at 1-minute intervals, perhaps extend it to every 15 minutes if possible.
  • If you’re using your account to hold emails, delete the trash, send, and spam in the email portion of your account.  These emails would take up space counting towards your inodes.  With some hosts, you can set it so that once the email has been loaded (from your device) it automatically deletes it off the server.
  • Have your domain served from Cloudflare.  Cloudflare’s has some great features to help cache some load off your server, which should help reduce a good amount of inodes that are being added up due to processing and serving web content to your users.  It’s free, and Cloudflare is phenomenal.  Check out the list of optimization features Cloudflare has in its arsenal!  Rocket loader, minifying, brotli are just some of the features.
  • You should be using a caching plugin on your WordPress site so that every page load on your website doesn’t equal to the same amount of page crunching the server has to do.  Check your host to see if they have a dedicated Hosting plugin that has caching features as they can probably utilize some proprietary solutions since they know their servers.  Siteground for example has one called SiteGround Optimizer.
  • Lastly, this one may help.  Bad bots may be hitting your website unnecessarily increasing your inodes, especially if it’s hitting a heavy load-baring page.  You can reduce this by installing BBQ Firewall and Blackhole.

Any other tips, love to hear them.  Feel free to contact me.