• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1166
  • Last Modified:

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.
0
infernothao
Asked:
infernothao
  • 5
  • 3
  • 2
1 Solution
 
arnoldCommented:
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.
0
 
Rance_HallCommented:
/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.
0
 
infernothaoAuthor Commented:
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

0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
arnoldCommented:
if you run mkfile 2m /tmp/somefile
you will get an error when the file reaches 1MB?
0
 
infernothaoAuthor Commented:
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
0
 
arnoldCommented:
run df -k on the system to make sure that your /tmp partition which is also used for swap is not near full.
0
 
Rance_HallCommented:
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
0
 
infernothaoAuthor Commented:
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.
0
 
infernothaoAuthor Commented:
Thanks guys. Problem solve. I just need to unmount tmp.
0
 
infernothaoAuthor Commented:
I figure out the solution by myself.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now