Question
How do I increase the size of the cPanel-generated /tmp filesystem?
Answer
Warning: You must reboot your server for this setting to take effect.
Changing this setting will delete the contents of your /tmp partition.
- Log into WHM
- Navigate to Home / Server Configuration / Tweak Settings and select the System tab
- Locate the setting Size, in MB, for the /tmp partition secured by securetmp
- Adjust the value from the default of Use algorithm to determine size to your desired size
CPANEL_INFO: Please note that this setting is using MB - Click on Save at the bottom of the page
- Reboot the server for the changes to be applied
Warning: We recommend this procedure only be performed by an advanced system administrator and only during a scheduled dedicated time since it requires temporarily stopping the services that write to /tmp.
This procedure only works on servers on which cPanel has generated /tmp. cPanel-generated /tmp filesystems have /dev/loop in their names, for example:
CONFIG_TEXT: [root@server]# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 477M 2.4M 449M 1% /tmp
If your server's current /tmp filesystem does not contain /dev/loop in its name, the filesystem was created outside by cPanel by the server's operating system or data center, and you will need to seek assistance from your data center with increasing the size of /tmp.
Warning: This procedure does not work on servers running in Virtuozzo or VZ environments.
- Log in as
root, either via SSH, or WHM / Home / Server Configuration / Terminal - Open
/scripts/securetmpin your favorite text editor. Find and modify the
tmpdsksizevalue to the desired size. For example, this sets the value to 10GB:# * my $tmpdsksize = 10485760
Use "#" characters to disable this section of the script.
CONFIG_TEXT: # my $five_percent_of_available = ( $available * 0.05 );
# if ( $five_percent_of_available > $tmpdsksize ) {
# $tmpdsksize = $five_percent_of_available;
# }
# my $FOUR_GIG_k = ( 1024 * 1024 * 4 );
# if ( $tmpdsksize > $FOUR_GIG_k ) {
# $tmpdsksize = $FOUR_GIG_k;
# }Check which services are currently using
/tmp:# lsof | grep /tmp | grep -v deleted
Using the output from lsof, temporarily disable monitoring for the services using
/tmp. For example:# whmapi1 configureservice service=cpsrvd enabled=1 monitored=0
whmapi1 configureservice service=mysql enabled=1 monitored=0
whmapi1 configureservice service=httpd enabled=1 monitored=0Using the output from lsof, stop the services that use
/tmp.For example:# /scripts/restartsrv_cpsrvd --stop
/scripts/restartsrv_mysql --stop
/scripts/restartsrv_httpd --stopUnmount
/tmpand/var/tmp:# umount -l /tmp
umount -l /var/tmpMove
/usr/tmpDSKfile to another location (in case you need to mount it elsewhere to preserve data):# mv /usr/tmpDSK{,.$(date +%s)}
Run this script to create the larger
/tmpfilesystem:# /scripts/securetmp
Restart the services you stopped previously. For example:
# /scripts/restartsrv_cpsrvd --start
/scripts/restartsrv_mysql --start
/scripts/restartsrv_httpd --startRe-enable monitoring for the services. For example:
# whmapi1 configureservice service=cpsrvd enabled=1 monitored=1
whmapi1 configureservice service=mysql enabled=1 monitored=1
whmapi1 configureservice service=httpd enabled=1 monitored=1
Comments
0 comments
Article is closed for comments.