Welcome to WebmasterWorld Guest from 54.162.227.136

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Moving cache files to memory

move files into tmpfs

     
11:29 am on Apr 21, 2011 (gmt 0)

10+ Year Member



I recently bumped into a blog post where the person suggested to move the cache files to memory. My website creates cache files in html format and stores them on disk. With this method the folder is moved to memory apparently. It has significantly reduced the memory usage strangely.

Is this correct?

mount -t tmpfs -o size=1G,nr_inodes=10k,mode=0777,noatime,nodiratime tmpfs /path/to/cache/folder
12:08 pm on May 3, 2011 (gmt 0)

5+ Year Member



I'm doing the same thing too in my /etc/fstab file, one example is:

tmpfs /var/cache/apache2/mod_disk_cache tmpfs defaults,noatime 0 0

Works like a charm for all kinds of temporary files.
A reboot will clear them.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month