Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 3:26

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
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 8:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.