Featured Posts

Using DKIM with Exim and cPanel Similar to the intentions of SPF records and DomainKeys, DKIM is intended to authenticate a sender by using a public/private key pair to digitally sign email, therefore increasing deliverability. At this...

Readmore

Copy Outgoing Email on a cPanel Server with Exim A common request we get is how a user can automatically BCC outgoing email to another address. This is most often requested by law firms that need to be able to retain copies of communication. Forwarding...

Readmore

Do You Care About Your Customers' Data? I was working a case last week for a new client that's been hosting local business websites for over three years. As with all of my case studies, I did a short survey of the client's infrastructure, processes,...

Readmore

Tips to Reduce Your Customer Support Costs When hosting websites, whether as a mainstream hosting provider, a hobby, or to supplement another service, it's your job to make sure your customers have access to technical support in case they need...

Readmore

Roundcube: MySQL or SQLite? cPanel 11.25 introduces a new feature: The ability to have RoundCube use SQLite instead of MySQL. After benchmarking resource usage and performance, I've come to the conclusion that SQLite is definitely...

Readmore

The cPanel Admin Rss

Increasing the Size of tmpDSK (/tmp)

Posted by Vanessa | Tagged under , | Posted on February 5, 2010

17

You may have noticed that cPanel’s default partition size for /tmp is 512 MB, which in some cases can be way too small.  The /tmp partition on cPanel servers, assuming it was the one cPanel created and not one you did yourself, is a file-based partition that can easily be resized.

By default on most servers, /tmp is the temporary dumping place for a lot of things, for example:

  • PHP session files
  • PHP temporary file uploads
  • MySQL temporary files
  • Cache files for certain Apache modules

Most software that uses temporary files or sessions will automatically prefer to use /tmp – this folder is usually set to 777  permissions and therefore writeable by every user on the server.

When your /tmp partition fills up, it can cause noticeable problems for your users. If you run a larger server, the /tmp folder can fill up quickly and be very annoying as far as maintenance is concerned. Fortunately there is a very easy way to increase the size of this partition on a standalone server.

  1. Stop MySQL, Apache, and cPanel to prevent writing to the /tmp partition
  2. Copy the contents of /tmp to another location, such as /home (cp -rfp /tmp /home)
  3. Unmount /tmp. If you’re unable to, you can do an lsof (lsof |grep /tmp) to see what processes are still writing to it, and kill them off. Or do a lazy unmount (umount -l /tmp) .
  4. Delete /usr/tmpDSK (rm -rf /usr/tmpDSK)

Now open /scripts/securetmp and look for this line:

my $tmpdsksize     = 512000;    # Must be larger than 250000

And change the “512000″ value to your desired size in MB, and save the file. Now run the following script to recreate /tmp:

/scripts/securetmp

This will recreate your /tmp (tmpDSK) partition using the size you specified. While the securetmp script may be overwritten in a cPanel update, the size of /tmp will not be affected one you alter its size.

Liking this article? Share it and spread the word!
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

Comments (17)

[...] this is a continual issue, try increasing the size of the /tmp partition: Increasing the Size of tmpDSK (/tmp) :: The cPanel Admin __________________ http://www.thecpaneladmin.com [...]

[...] Increasing the Size of tmpDSK (/tmp) [...]

What would you recommend making the size of the /tmp ? thanks Mally

Usually between 1-2GB

[...] WHM kullanarak /tmp boyutunu değiştirme: Link [...]

Hello there thx you very much

Actually, the permissions of /tmp should be set to 1777, not 777. The sticky bit should be set to ensure that users are unable to modify other user’s data. Most phpmyadmin errors and common PHP script errors (such as /tmp/.sessXXXXXXXX) can be eliminated by properly setting /tmp to 1777.

phpMyAdmin and other cPanel software now use /var/cpanel/userhomes for tmp data storage – so the permissions of /tmp as 777 or 1777 will both work.

Thank you. very helpful!

Hi thanks for this tutorial,

Is there anything in the /tmp folder copied to /home/tmp that needs to be put back after following the rest of the process. Or is everything that was in the original expendable?

thanx this helps me…

Worked perfectly on a CentOS VPS (Linode) – Didn’t even need to reboot!

Also, the reason I needed to do this is because it keeps getting full. Is there any thing I can do to make sure it stays clean?

It depends – do you know what’s filling it up?

Thanks for your guide.

I followed the guide – any ideas why my /tmp size hasnt’ increased by the /usr/tmpDSK has?

/tmp /var/tmp 3% (13,410 of 495,844)
/usr/tmpDSK /tmp 2% (36,908 of 2,015,824)

Thanks

Kevin

You need to many sure that /tmp is mounted using /usr/tmpDSK. Yours isn’t.

Write a comment