Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I was wondering if there is any disadvantage of increasing /tmp folder size? By default, it is 2Mbytes on my system. I would like to increase it to 10~15Mbytes. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    10

    Disadvantage of increasing /tmp


    Hi,

    I was wondering if there is any disadvantage of increasing /tmp folder size?

    By default, it is 2Mbytes on my system. I would like to increase it to 10~15Mbytes.


    Since /tmp is memory, where does Linux take the space from when I re-size it? The shared memory seems to stay the same?

    Thanks,
    S

  2. #2
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,377
    /tmp isn't always in memory - sometimes it's just directory. If it is defined as a tmpfs then it is either in memory or swap. The size field is a maximum size and chances are you aren't using very much.

    I'm not aware of there being any issues - the memory won't be used until needed.

    It could be defined as a ramfs but (to me) that wouldn't make much sense since /var/tmp is available for files that need to be persisted.

  3. #3
    Just Joined!
    Join Date
    Mar 2011
    Posts
    10
    Quote Originally Posted by gregm View Post
    /tmp isn't always in memory - sometimes it's just directory. If it is defined as a tmpfs then it is either in memory or swap. The size field is a maximum size and chances are you aren't using very much.

    I'm not aware of there being any issues - the memory won't be used until needed.

    It could be defined as a ramfs but (to me) that wouldn't make much sense since /var/tmp is available for files that need to be persisted.

    Well, this is what I did:


    # df -h
    Filesystem Size Used Available Use% Mounted on
    rootfs 504.0M 55.5M 448.5M 11% /
    /dev/root 504.0M 55.5M 448.5M 11% /
    tmpfs 62.0M 56.0k 62.0M 0% /dev
    shm 62.0M 0 62.0M 0% /dev/shm
    rwfs 2.0M 1.3M 760.0k 63% /mnt/rwfs
    rwfs 2.0M 1.3M 760.0k 63% /tmp
    rwfs 2.0M 1.3M 760.0k 63% /var



    Resized /tmp

    # mount -o remount,size=10M rwfs /tmp

    # df -h
    Filesystem Size Used Available Use% Mounted on
    rootfs 504.0M 55.5M 448.5M 11% /
    /dev/root 504.0M 55.5M 448.5M 11% /
    tmpfs 62.0M 56.0k 62.0M 0% /dev
    shm 62.0M 0 62.0M 0% /dev/shm
    rwfs 10.0M 1.3M 8.7M 13% /mnt/rwfs
    rwfs 10.0M 1.3M 8.7M 13% /tmp
    rwfs 10.0M 1.3M 8.7M 13% /var



    Notice that /tmp and /var got resized to 10M ??

    I see that tmpfs and shm are the same so I presume /tmp and /var are RAM.

    So allocating more size to the /tmp will take memory off the shared memory (shm) ?

    Will this affect the performance ?

    Thanks,
    S

  4. #4
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,377
    Until the memory is used it won't take it off of anything or affect anything. Tmp will and I suspect that both filesystems will use swap if ram is unavailable - again this only happens when something is actually written to them.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •