wesupport

Need help?

Our experts have had an average response time of 13.14 minutes in February 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Increase cPanel /tmp filesystem size easily

by | Nov 24, 2021

We need to increase the cPanel /tmp filesystem size because, by default, it is 4GB or 5% of the /usr filesystem size.

As part of our Server Management Services, we assist our customers with several cPanel queries.

Today, let us see how our engineers increase the size.

 

cPanel /tmp filesystem size

Our Support Techs recommend the procedure below to be done by an expert system administrator.

In addition, since we have to temporarily stop the services that write to /tmp, we have to perform this on a scheduled time.

This procedure only works on servers on which cPanel has generated /tmp.

Suppose if it does not contain /dev/loop in its name, cPanel created the filesystem by the server’s operating system or data center.

In such a case, we need to seek assistance from the data center to increase the size of /tmp.

Moving ahead, let us see how our Support Techs perform the same.

 

How to increase cPanel /tmp filesystem size

1. To begin with, we can modify the following line in /scripts/securetmp to set tmpdsksize to the desired size.

For instance, here we are using 10 GB:

my $tmpdsksize = 10485760

2. Then we comment out the below section of /scripts/securetmp:

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;
}

3. We need to confirm which services are currently using /tmp:

lsof | grep /tmp | grep -v deleted

4. After that, we will 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=0

5. Then we stop the services that use /tmp:

/scripts/restartsrv_cpsrvd --stop
/scripts/restartsrv_mysql --stop
/scripts/restartsrv_httpd --stop

6. Later, we unmount /tmp and /var/tmp:

umount -l /tmp
umount -l /var/tmp

7. In addition, we can move the /usr/tmpDSK file to another location to mount it elsewhere to preserve data:

mv /usr/tmpDSK /usr/tmpDSK_bak

8. Eventually, to create the larger /tmp filesystem, we run:

/scripts/securetmp

9. And then we restart the services we stopped previously:

/scripts/restartsrv_cpsrvd --start
/scripts/restartsrv_mysql --start
/scripts/restartsrv_httpd --start

10. Finally, we re-enable monitoring for the services.

For example, like this:

whmapi1 configureservice service=cpsrvd enabled=1 monitored=1
whmapi1 configureservice service=mysql enabled=1 monitored=1
whmapi1 configureservice service=httpd enabled=1 monitored=1

[Need further assistance? We are available 24*7]

 

Conclusion

In short, we saw how our Support Techs increase the filesystem size.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

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

Categories

Tags