08
Dec 12

cPanel based server is slow and server load is always high : Fixed

Recently I found that one of servers was very slow and customers were complaining. I found that the load on the server was consistently above 15.  The culprit was huge 8Gb eximstats MySQL database maintained by cPanel and low free disk space. I fixed it by proceeding as follows:

– Logged in to server using ssh
– ‘df -h’ revealed only 7 Gb was free disk space out of 110 Gb. Not a happy sign.
– Did ‘cd /’ followed by ‘du -h –max-depth=1’. It revealed that /var folder was occupying over 20 Gb space
– Futher investigations reveled that the eximstats database in /var/lib/mysql was occupying 8 Gb of space. I decided to handle that.

You can do all of the above via WHM too. In WHM -> Server Status -> Server Information, current disk usage section will give you free disk space. WHM -> phpMyAdmin and selecting eximstats database shows how much disk space it occupies.

I searched in Google to find out more about eximstats. It seems, these are stats of exim maintained by cPanel. By default, cPanel retains stats for 30 days.  Time for more action …. logged in to WHM

– In WHM -> Tweak settings -> Stats and Logs section, changed value of  “The interval, in days, to retain Exim stats in the database” from 10 to 7 and clicked save
 – To save disk space, I decided to retain only Webalizer stats. Went to WHM -> Tweak settings  “Stats” section. Disabled all stats programs except Webalizer and clicked Save

Now time to clean up the eximstats database.

– In WHM -> phpMyAdmin selected eximstats database and “truncate” all tables i.e. sends, smtp, failures and defer. This took a very long time as the size of database was big.

Now I checked free disk space via WHM -> Server Status -> Server Information . Current disk usage section was showing 15 Gb of free disk space. That was a good sign. Just to be sure I rebooted the server using WHM-> System Reboot -> Graceful Server Reboot. After sometime when server came online, I found that the server load settled to 0.9 to 1.2 and free disk space was over 15 gb!

I logged in to server again after a few days. Server load was still  between 0.5 to 1.5 and free space was around 20Gb. What a relief!