2

I have a Wordpress site which uses a file cache to store various object information.

Now I would like the time to access the data in the cache to be much shorter, and I have heard various people on the net suggesting that it would be a good idea to mount the cache so that the data is stored in memory. Specifically, they have suggested using tmpfs for this.

I attempted to do this by running the following command:

mount -t tmpfs -o size=128 tmpfs /home/myaccount/mycache

But I observe that this does not seem to significantly improve page load times. Is there a way I can check that the data in the cache is definitely being accessed from memory? Or this there a reason that the cache may seem not to be having an effect?

Tola Odejayi
  • 334
  • 1
  • 4
  • 19
  • Are you sure that Wordpress is accessing files from that directory? 1) It might not be configured to point there; 2) if you started Wordpress before mounting that directory with tmpfs, Wordpress will probably still be using file handles to the mount point (as opposed to tmpfs) – Handyman5 Dec 28 '11 at 03:26

1 Answers1

3

Operating systems will cache data in RAM (when there's RAM available) from disk-based filesystems, too - which would explain why you're not seeing improved page load times.

But, you can verify that the data is indeed being stored only in RAM by verifying that that location is indeed a tmpfs location - just run the mount command with no arguments to list mounts, which should include your tmpfs filesystem.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
  • I can verify that when I type `mount`, I do see an entry which corresponds to my cache location. It would have been nice to verify for sure where the data was coming from, though. – Tola Odejayi Dec 28 '11 at 08:58