Speed up your site caching -- using RamDrive

dolphinbugfixing posted 14th of October 2010 in Community Voice. 4 comments.

I found out that caching in dolphin 7.x.x has some negative impact in speed because in reality the cache files resides in the hard drive and what if your hard drive is not that fast to retrieve files this is a problem for sites with lots of files. To tweak the existing caching method of dolphin is to create a RAM DRIVE and point the cache_public folder and eaccelerator folder to a RAM DRIVE folder.

 

How to create a Ram Drive Example :


edit your linux boot menu to add the ramdisk_size=262144

Debian -- /boot/grub/menu.lst

Centos -- /boot/grub/grub.conf

 

Then create the Ram Drive

# mkfs -q /dev/ram1 262144
# mkdir -p /ramcache
# mount /dev/ram1 /ramcache
# df -H | grep ramcache

 

To point the dolphin folder using symbolic link command example below :

 

mkdir /ramcache/cache_public
chmod 777 /ramcache/cache_public
ln -s /ramcache/cache_public /home/account/public_html/cache_public

 

Put this in your /etc/rc.local

mkdir /ramcache/cache_public
chmod 777 /ramcache/cache_public

 

It's not just the cache_public folder and eaccelerator folder, you can put your template images to the ram drive too, These are the possible content that can be in the Ram Drive :

 

media/images/flags
templates/base/icon
templates/base/images
templates/tmpl_uni/icon
templates/tmpl_uni/images
tmp

 

 

Benefits : Faster script execution time and optimized web server content delivery.

 

Take note :

Eaccelerator folder is only available if you installed php eaccelerator.

This tweak applies to VPS and Dedicated Server only. Make sure you have enough Ram Available.

 

by Pedro here in dolphinbugfixing.com

 
Comments
·Oldest
·Top
Please login to post a comment.
AlexT
By default it uses files cache, however two other cache engines (Memcached, eAccrllerator) uses shared memory cache, not files based cache.
These engines were added in Dolphin 7.0.3.
dolphinbugfixing
@AlexT, thank you for that.

Question -- Do you agree using RAMDRIVE for the file based cache for example the Profiles Cache will improve performance?
AlexT
@dolphinbugfixing

Yes, it can help, but since it can be big number of profiles and other cache data - this cache folder can be full very fast. Memory based cache has build-in mechanism to delete old data when there is no space for new data - memory based disk has no such functionality.

I suggest to install cron along with this memory based disk, which will check space of this memory device and delete past recently used files if more than 70-80% of disk space is used.
dolphinbugfixing
@AlexT

Thank you thats a good idea. awesome!
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
PET:0.048698902130127