Cache Tuning for Inodes

I have been struggling with my website’s backups running.  Host Gator requires the Inode count to be under a certain level in order for the backups to run.  The best part about it is that they have added tools to the CPanel to show the usage and backup status.

After fixing the problem, here’s what my backup status panel looks like:

Backup Status Panel

Also, farther on down the left hand column, Host Gator offers an Inode measurement.  Again, after fixing, here’s what mine looks like:

Inode Status Indicator

Last time, I messed with the git repositories to clean up some of the inode usage.  This time, I looked into the WordPress Caching.  I am using a cache plugin called W3 Total Cache.  Because it was not configured correctly, it was using up more inodes than it should have.

So, it was time to check on performance again, and I wanted to do a before and after performance measurement.

Tools for Measuring Performance

Previously, I used these tools to measure performance:

This time, YSlow didn’t work for me for some reason.  Rather than troubleshoot it, I left it off the list.

Before

First up is my home page, digitaleagle.net.  W3 Total Cache has no affect on this, but still I wanted to write down my results for comparison purposes.

Page Speed
Score: 84 out of 100
Low Priority: Improve Server Response Time, Optimize Images, Enable Compression, Specify a character set, Leverage Browser Caching, Specify a Vary: Accept Encoding Header
Web Page Test
Previously: 0.410s / 0.030s
Now: 1.176s / 0.078s
PageSpeed 1.12 Score: 80/100
First Byte Time: F
Keep Alive Enabled: A
Compress Transfer: B
Compress Images: A
Progressive JPEGs: A
Cache Static Content: F
CDN Detected: X

Next is a longer Step-By-Step post that I have written, http://psst0101.digitaleagle.net/2011/02/21/step-by-step-peopletools-8-51-upgrade-part-4/:

Page Speed
Score: 82 out of 100
High Priority: Improve Server Response Time, Serve scaled images
Medium Priority: Minimize redirects, Combine images into CSS sprites, Optimize Images
Low Priority: Inline Small CSS, Inline Small Javascript, Prefer asynchronous resources, Minify HTML, Put CSS in document head, Specify a character set, Leverage browser caching, Defer parsing of Javascript, Specify a cache validator, Remove query strings from static resources, Specify a Vary: Accept-Encoding header
Web Page Test
Previously: 5.269s / 3.310s
Now: 4.694s / 1.139s
PageSpeed 1.12 Score: 87/100
First Byte Time: F
Keep Alive Enabled: A
Compress Transfer: A
Compress Images: A
Cache Static Content: C
CDN Detected: X

Next is shorter different post:  http://psst0101.digitaleagle.net/2011/12/19/running-jasper-reports-from-java/

Page Speed
Score: 85 out of 100
High Priority: Improve Server response time
Medium Priority: Combine images into CSS sprites
Low Priority: Minimize redirects, Inline Small CSS, Inline Small Javascript, Prefer asynchronous resources, Optimize images, Minify HTML, Put CSS in the document head, Specify a character set, Leverage browser caching, Defer parsing of Javascript, Specify a cache validator, Remove query strings from static resources, Specify a Vary: Accept Encoding header
Web Page Test
Previously: 3.399s / 2.800s
Now: 4.081s / 1.348s
PageSpeed 1.12 Score: 92/100
First Byte Time: F
Keep Alive Enabled: A
Compress Transfer: A
Compress Images: A
Cache Static Content: D
CDN Detected: X

Inode Counting

Gator Hosting has an Inode Distribution tool, but it didn’t seem to work correctly. For my Linux Sagas blog directory, it reported only 13219. Then, for the directory holding all 3 of my blogs, it reported: 11,310. So, I don’t think it was quite working correctly.

So, I fell back to my command-line method from my old post:

find . -printf "%i\n" | sort -u | wc -l

Here’s a better script that will break it out for each directory in the current directory:

for d in $(ls -d */); do
echo -n "$d:  "
find $d -printf "%i\n" | sort -u | wc -l
done

And, here are the results:

  • Linux Sagas: 74,467
  • PSST0101: 11,406
  • Personal: 9,898

I drilled down on the Linux Sagas blog, and these are the directories that had the biggest usage:

  • wp-content/cache: 63726
  • wp-content/plugins: 6328
  • wp-content/cache/page: 63534
  • wp-content/cache/db: 186

Updating the Settings

I found a post where “GatorEAnderson” recommended turning off Database Cache and Object Cache:

The main thing is that Database Cache and Object Cache are disabled. On shared hosting, these create a lot of disk I/O for no real benefit. It’s a different story for VPS/Dedicated servers, where those can really improve performance, but it’s just a bad idea for Shared hosting.

Also, Gator Host has some recommendations that say to turn the Page Cache on with Disk: Advanced.  I had one or two of my blogs set with Disk: Basic.

So, I checked the settings on the General Performance Settings page:

General Performance Settings Page

I made sure the Page Cache Method was set to “Disk: Advanced”:

Page Cache Method Settings

Finally, I made sure that the Database Cache and Object Cache were disabled:

Database and Object Cache Settings

Google Page Speed

I noticed that I didn’t have Page Speed configured in W3 Total Cache.  So, I decided to head down that path.

I visited the APIs Console to get a key.  Then, I clicked “Create Project”:

Google Page Speed Project

Then, I activated the “Page Speed Online API”:

Activating Page Speed API

Next, I had to agree to the terms:

Agreeing to the API

Then, to get the key, I went to the API Access section:

API Access tab

Finally, I entered the API Key on the General Settings page on my blog:

End Results

So, after the changes, I checked my results to make sure that I didn’t break anything:

First Step By Step Page —

Before:

  • PageSpeed: 82
  • Web Page Test: 4.694s / 1.139s (87/100)

After:

  • PageSpeed: 81 (on the 2nd analysis: 82)
  • Web Page Test: 4.977s / 1.990s  (87/100)

Second Jasper Reports page —

Before:

  • PageSpeed: 85
  • Web Page Test: 4.081s / 1.348s (92/100)

After:

  • PageSpeed: 72 (on the 2nd analysis: 64)
  • Web Page Test: 2.897s / 1.001s (92/100)

Inode Results Later

After letting it run for several days, I came back and remeasured the Inodes.  The Linux Sagas blog was much better.  The other blogs weren’t as much improvement:

  • Linux Sagas: 11,407
  • PSST0101: 9,951
  • Personal: 5,451

Resources

Leave a Comment

Your email address will not be published. Required fields are marked *