1843992 Members
1797 Online
110226 Solutions
New Discussion

Sizing /tmp

 
SOLVED
Go to solution
Bob Manocchia
Regular Advisor

Sizing /tmp

What is the optimal space for sizing the /tmp directory. My take is that making it too large would encourage users to dump some large files there. We have an SOP indicating that we should make /tmp 5gb, which I consider too large.
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: Sizing /tmp

Shalom,

Thats a pretty big waste of space, 5 GB.

If you have some custom applications that need that kind of space, there are serious security issues as well as /tmp must be open access for many appications to function properly.

don't do it to accomodate oracle installs, you can redirect its temporary directory with an environment variable.

In general, absent special needs, its to big.

Nothing to lose ones job over though. Disk space is cheap.

Good Luck.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: Sizing /tmp

/tmp should be about 256MB tops. Why? Because /tmp is supposed to only be used by the OS. User temporary files should go in /var/tmp (unless overriden by setting the env variable TMPDIR). This has been standard practice for at least two decades. As to the size of /var/tmp , that depends entirely upon the application(s) and user requirements.
If it ain't broke, I can fix that.
DCE
Honored Contributor

Re: Sizing /tmp

5 GB is a LARGE /tmp directory. But you need to take into consideration how your apps/system uses the directory.

some apps (autosys comes to mind) writes multitudes of files to /tmp. Other apps write their standard output/error logs to /tmp. Users have been known to store large quantites of data there as well.

I would suggest looking at the /tmp usage on your existing systems, and determine how full they are, and how old the files are in the directory.

Rather than making /tmp outragously large, you might want to consider a simple script run from cron (daily) that deletes all the files/directories older than say, one week, in the directory. It is a temporary directory after all. If you do this, iclude the other tmp directory - /var/tmp.





James R. Ferguson
Acclaimed Contributor

Re: Sizing /tmp

Hi Bob:

With larger, and larger boot disks, I like to have a very generous '/tmp' and '/var'. I generally create a 2GB '/tmp'. For building large patch depots it's nice to have.

If you're concerned about "abuse' of the space, write a simple script that runs as a cron job. The script simply queries the usage of '/tmp' by your users and reports (mails) to you the number of files and the total space taken up by each user.

There is nothing to require you to backup '/tmp' either, if having a potentially large space available is a concern.

Regards!

...JRF...
Bob Manocchia
Regular Advisor

Re: Sizing /tmp

Thanks everyone. Your feedback was just what was needed. I can now take these responses and use them to justify shrinking this monster.