Sunday, October 26, 2014

Disabling Core Dumps in cPanel

I recently found a (cPanel) server was generating over 100Gb of core dumps every time a bad PHP script died or Apache died. Writing these generally useless (who actually debugs these on a live web server) to disk is a pointless waste of disk I/O, especially in a VPS environment.

Here is two methods of disabling core dumps;cPanel/WHM

  1. Login to WHM
  2. Select ‘Tweak Settings’
  3. Search for ‘core’
  4. Turn ‘Generate core dumps’ off.
Linux

I usually do this on cPanel servers also, just to be double sure!

1. Disable core dumps for all users.
Edit /etc/security/limits.conf and check that * hard core 0 exists

2. Disable core dumps for setuid programs


echo 'fs.suid_dumpable = 0' >> /etc/sysctl.conf
sysctl -p

3. Finally, set a soft limit to stop core dumps being created

echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile
No reboot required.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews