Page 1 of 1

Ramdisk size for tmpfs

Posted: 2012/02/17 22:39:27
by Nentoos
Hi Peoples,

i have a question.
I have a system with 16GB RAM und the /etc/fstab have the following content:

none /tmp tmpfs defaults 0 0

This is for Ram drive an it take as standard 50% from the avaiable size.
And i now how can i fix it:
none /tmp tmpfs defaults,size=424m 0 0

My question is what is the best size for it.
It is a Web Server with 12 Domains.

Now it is 8GB and i think it is a little to big.
Sorry for my bad english ;)
And thanks for replays

Ramdisk size for tmpfs

Posted: 2012/02/17 23:26:55
by pschaff
Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

Your question is quite clear, the answer less so. There is no "best" size. I'd suggest monitoring usage, and if it is filling up, then increase the size. You could use a cron job to check it periodically and write to a log, or just do it manually. Be careful as bad things can happen if it fills up.

Re: Ramdisk size for tmpfs

Posted: 2012/02/18 00:56:39
by TrevorH
It doesn't actually use any space unless something is writing to it. The RAM is not committed until it's written to and when it is, then it's swappable anyway. However, monitoring it is a good way to find out. In all the installs I've done, the default set up is not configured for anything to use it, you have to explicitly point things at it to get it used.

Re: Ramdisk size for tmpfs

Posted: 2012/02/18 08:07:05
by Nentoos
Ok thanks a lot for your answers.
I will log it with a cron job every 24 h.

I think this the best way.

Thanks a lot.

Re: Ramdisk size for tmpfs

Posted: 2012/02/18 12:15:12
by pschaff
I'd start with every hour or so to get a better idea of the trend.