Not enough space in tmp due to eaccelerator

OS : Linux CentOS 5, cPanel® 11.24

Problem :

a. Centos /tmp keeps on getting full, culprit identified is EAcclerator.
b. Production server that needs minimal down time minimal changes.

Scope :

a. OS is CentOS 5.2 redhat
b. /var has more than 4GB free space
c. Have administrator and root access

Possible solution :

a. Recompile Apache with EAccelerator disabled.
b. Create cron to clear to clear space in regular interval.
c. Create a customed script that clears EAccelerator cache at regular interval.

What is your choice ?

Let us scrutinize the available options :

a. Recompile Apache with EAccelerator disabled.
– Lets get real, recompile Apache will takes a very long time.
– Since we are using on Production server, it will be disastrous if a user or more requires EAccelerator to run 100%.

b. Create cron to clear to clear space in regular interval.
– Simple solution but it will clear necessary EAccelerator session.
– Causes data lost or interrupted sessions or web application misbehavior.

c. Create a customed script that clears EAccelerator cache at regular interval.
– Too complicated, script needs to be developed.
– Inheriting same problem like solution b.

My choice is d 😛 which is creating symbolic link to /var/eaccelerator .

Steps :
1. Login to your server SSH.

2. Go to the /tmp path.
root@localhost [~]#cd /tmp
root@localhost [/tmp]#

3. Stop your web service.
root@localhost [/tmp]#service httpd stop
OR
root@localhost [/tmp]#/usr/local/apache/bin/apachectl stop

4. Remove original EAccelerator from the /tmp.
root@localhost[/tmp]#rm -Rf eacclerator/

5. Create directory and symbolic link.
root@localhost[/tmp]#mkdir /var/eaccelerator
root@localhost[/tmp]#ln -s /var/eaccelerator eaccelerator

6. Provide proper permission for the symbolic link.
root@localhost[/tmp]#chmod 1777 eaccelerator/ -Rf

7. Restart web service.
root@localhost[/tmp]#service httpd start
OR
root@localhost [/tmp]#/usr/local/apache/bin/apachectl start

8. To test, load a website that uses EAccelerator and check in /var/eaccelerator is there is folder named 0 to 9 is created.

*Note : I have not test if after reboot the symbolic link created will retain in /tmp.

One thought on “Not enough space in tmp due to eaccelerator

  1. I am confusing on the “chmod 1777 foldername/”. How you determine the permission as 1777, as far that I know is permisson can be define with 3 char, xxx. Can brief me on this.

    Jai – 1777 is a special permission, that will gives every1 to write with ownership to the same directory. You can check if the directory with the /tmp permission, it should show trwxrwxrwx .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.