Problem with script languages is that the scripts have to be parsed and compiled each time when the script is executed. Each time when you visit some PHP page, your server must parse and compile the script before executing. Can you imagine how much CPU time would be saved if those scripts are parsed and compiled only once, and then executed multiple times? Well, you don’t have to imagine because softwares, like eAccelerator, do exactly that.
eAccelerator is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.
Installation
If you have the dedicated server, and you seek the way to improve your server performances, I would highly recommended you to install the eAccellerator. Although I’m not very experienced Linux admin, I had no problems with the installation by following the installation from source guide. Before compilation check all compile parameters if you want to enable additional functions like eaccelerator_put and eaccelerator_get (I will write about using shared memory functions in some other post). If you are running Windows machine at home, here you can find eAccelerator Windows binaries.
Configuration
You can find details about all eAccelerator configuration variables here. Probably the most important variable is the eaccelerator.shm_size which represents the size of the memory dedicated to the eAccelerator. How much memory you have to dedicate to the eAccelerator? Well, with the eAccelerator you will also get the control.php that you should copy on your web server. By navigating your browser to the control.php you will see the eAccelerator memory usage and other things on the web page. Set some starting shm_size value and monitor this page first few days and then see should you increase or decrease memory size for eAccelerator. From this control panel you can also easily clear the eAccelerator cache from the memory.

If eAccelerator is unable to cache the script in memory, it will by default use file system for the caching by saving cached content inside the directory specified with eaccelerator.cache_dir. If you want to use only memory for the caching, set eaccelerator.shm_only to 1. Also check the eaccelerator.shm_ttl and eaccelerator.shm_prune_period. This variables tells eAccelerator which old scripts to remove from memory if there is not enough shared memory to cache a new script.