Link to home
Start Free TrialLog in
Avatar of infernothao
infernothao

asked on

Linux - Size Limit On "tmp"

Hi experts,

I have a odd question. All our websites run under Debian and it has all the latest updates.... at least that is what I think. About three weeks ago, I notice that there were a size limit on normal file upload. I couldn't upload any file over 1MB. Later I find out that it was the size limit set for "tmp" directory on the Debian server. I changed the php configuration, so that it pointed else where and not "tmp". That fixed it. But that was only the beginning, other components do use tmp also. Now when the crontab runs and try to generate xml files, it will only be able to generate one file that is under 1MB. But when I run it manually without the crontab, it was able to generate all xml files. I believe the reason it was able to generate those files when I run it without crontab is that the php temp memory location is set else where and not "tmp". My question is there a way to remove the size limit to directory "tmp", not the directory itself. Also, how did that size limit was created for tmp when no one had created it? Thanks.
Avatar of arnold
arnold
Flag of United States of America image

Check your /etc/php.ini file to see whether it is the one that has a limit.
check limit/ulimit
http://linux.derkeiler.com/Mailing-Lists/Debian/2004-08/2614.html
su - username and then run ulimit -a or specifically ulimit -f and see what the limit on the file size is set to if any.
Avatar of Rance_Hall
Rance_Hall

/tmp may have a size limit depending on your servers configuration.

Things to check:

Is the file system that /tmp lives on full?  Many sysadmins create small dedicated partitions for /tmp so that the space is not overused.

userlimits.  If you are using userlimits then the users that the webserver and other server processes run as should be exempted from user limits or at least be given sane limits to avoid runaway processes instead of day to day use.

php.ini and the other configuration files can limit file size as well, be sure and check those.
Avatar of infernothao

ASKER

Arnold, attached is what I got. The size limit for tmp is only 1MB.

--- ulimit -a ---
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

--- ulimit -f ---
unlimited

Open in new window

if you run mkfile 2m /tmp/somefile
you will get an error when the file reaches 1MB?
Yup... I tried copying an image file, which is 2mb, and below is what I get.


writing `/tmp/Cover-GGCC.jpg': No space left on device
run df -k on the system to make sure that your /tmp partition which is also used for swap is not near full.
ok so the /tmp space is full

Time to start cleaning out /tmp files

Might not hurt to create a /tmp maintenance script that deletes files not looked at in X days so that the problem does not recurr
I already clean out tmp. The problem is the size limit is too small. It's only 1MB. Any files that are less then 1MB works fine.
ASKER CERTIFIED SOLUTION
Avatar of infernothao
infernothao

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I figure out the solution by myself.