On Solaris /tmp is mounted swapfs and is it correct to put the eaccelerator files into /tmp/eaccelerator. You will have to remake the directory after a reboot.
In linux tmpfs can be used in the same way, either on /tmp or elsewhere.
See: http://www-128.ibm.com/developerworks/library/l-fs3.html
My updated task is now.
On Ubuntu:
mkdir /var/tmp/eaccelerator
sudo chown www-data.www-data /var/tmp/eaccelerator
sudo mount -t tmpfs tmpfs /var/tmp/eaccelerator
In your php.ini, change this line to:
eaccelerator.cache_dir="/var/tmp/eaccelerator"
Now put it in your /etc/fstab:
tmpfs /var/tmp/eaccelerator tmpfs defaults 0 0
And restart Apache:
sudo /etc/init.d/apache2 restart
You now don't have to recreate the /var/tmp/eaccelerator directory after the reboot, and the tmpfs will automount.
If you are VERY clever, then you might copy the cached files off of the tmpfs when apache stops and copy the cached files back on when apache starts.
While tuning this I got a %75 decrease of page time and %80 decrease of memory usage. (I also had a database issue from the old perspective.php script)
My courses page takes 0.368522 secs and RAM: 3.9MB
Your milage may vary,
Mikel
Linux tmpfs
猜你喜欢
转载自yuanhsh.iteye.com/blog/1328146
今日推荐
周排行