Re: [ilugd] Question about SWAP and tempfs

2011-04-26 Thread Manish Kumar
It's no hard and fast rule that swap space should be 2xRAM size.
In your case, having a 48 GB RAM means that you can live with any amount of 
swap space. You don't need 96 GB at all. Because 96 GB of swap space means that 
much of swapping, and if your system is gonna do that much of swapping, then it 
will die in sometime.
Also you can decrease or increase the tmpfs size but i wouldn't recommend. As 
tmpfs allocates the size dynamically, so if you need RAM then it will swap the 
pages in tmpfs to swap space and you will get more memory to work with.
Still i you want to play with tmpfs then change the parameters in the 
/etc/fstab file.
mount -t tmpfs -o size=1G,nr_inodes=10K,mode=0700 tmpfs /space
In this example it will use only 1G of RAM for tmpfs. 
Hope this helped. In case of any further queries feel free to ping me at 
manish01...@gmail.com, as i don't check this ID for months :)
~ManishYahoo!
--- On Mon, 4/25/11, Rakesh Kumar kumar3...@gmail.com wrote:

From: Rakesh Kumar kumar3...@gmail.com
Subject: Re: [ilugd] Question about SWAP and tempfs
To: The Linux-Delhi mailing list ilugd@lists.linux-delhi.org
Date: Monday, April 25, 2011, 2:37 PM

[...]
On Mon, Apr 25, 2011 at 12:49 PM, Amit Sharma amit_...@yahoo.com wrote:

 Hi,

 Couple of questions:

 1. SWAP partition must always be 2 x RAM? My machien has 48 GB RAM. I have
 to create 96GB SWAP partition? Isn't 4 GB or 8 GB good enough?

[...]
SWAP partition should be and not must be 2 x RAM. It's a rule of thumb
that you should have this much RAM. Your swap size depends upon the
applications you are gonna use. I agree with Ankit and would suggest that
8-10 GB swap is enough and keep monitoring it.
As i know modern kernels comes with a parameter *swappiness* and it's
parameters varies from 1 to 100. Higher values lead to more pages being
swapped, and lower values lead to more applications being kept in memory,
even if they are idle. By default it's set to 60(not sure) so you can change
it also to see if it fits you.


 2. tempfs consumes half of RAM i.e. 24GB in my case as I have 48 GB of
 physical RAM installed. Can I reduce it to say 8GB? Can it be done? How? Is
 it recommended to reduce tempfs?

regards,
 Amit Sharma


 Thanks and Regards,
 Amit Sharma

 ___
 Ilugd mailing list
 Ilugd@lists.linux-delhi.org
 http://frodo.hserus.net/mailman/listinfo/ilugd




-- 
Regards
RAKESH KUMAR
http://www.openwebtech.in
http://raakeshkumar.wordpress.com
___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd
___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd


Re: [ilugd] Question about SWAP and tempfs

2011-04-26 Thread Karanbir Singh

On 04/26/2011 03:03 PM, Manish Kumar wrote:

It's no hard and fast rule that swap space should be 2xRAM size.


Thats partially true. The idea of 2xram came from the linux-2.2 kernel 
VM and how things were handled in those days ( and I suspect before then 
); Having 2xram actually made some of the swap ops faster in/out and 
there should be plenty of quantifiable evidence for that around.


thinks have changed quite a lot since those days. with a newish 2.6 
kernel = 8 GB of ram and the sort of app one might be running its worth 
considering what you want to achieve with the swap. In most cases, 
unless you are running nearline ssd at 400MB/sec or better +rw - 
swapping into 4+ GB is usually 'bad' for the overall machine state. Some 
swap usage will happen, and unless you are trying to fix a real issue - 
just going with system distro defaults is considered reasonable.


btw, most sysadmins these days keep swap limited to 4 or in some cases 8 
gb, but still consider aligning it with real physical ram. So 10GB on a 
48GB ram machine sounds off. I'd recommend 8 or 12 instead.


w.r.t tmpfs, its allocated and managed dynamically. So its not usually a 
big concern. However, why use tmpfs at all !


- KB


___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd


[ilugd] Question about SWAP and tempfs

2011-04-25 Thread Amit Sharma
Hi,
 
Couple of questions:
 
1. SWAP partition must always be 2 x RAM? My machien has 48 GB RAM. I have to 
create 96GB SWAP partition? Isn't 4 GB or 8 GB good enough?
 
 
2. tempfs consumes half of RAM i.e. 24GB in my case as I have 48 GB of physical 
RAM installed. Can I reduce it to say 8GB? Can it be done? How? Is it 
recommended to reduce tempfs?

regards,
Amit Sharma


Thanks and Regards,
Amit Sharma
 
___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd


Re: [ilugd] Question about SWAP and tempfs

2011-04-25 Thread Ankit Chaturvedi
On Mon, Apr 25, 2011 at 12:49 PM, Amit Sharma amit_...@yahoo.com wrote:

 Hi,

 Couple of questions:

 1. SWAP partition must always be 2 x RAM? My machien has 48 GB RAM. I have
 to create 96GB SWAP partition? Isn't 4 GB or 8 GB good enough?


2xRAM is not a hard rule, you can have any amount of swap space. In your
case, since you have a large amount of RAM you'll hardly need the swap space
so ~10G should be good enough. However, if you're working with several large
files (think enterprise mysql servers) at the same time, you might gain from
a larger swap. I'll suggest using LVM so you can resize partitions and start
out with something like 6-8G. If you see swap usage above 80%, increase the
size of swap. Also, if you have multiple disks it's better if you have
multiple swap partitions spread over all the disks.



 2. tempfs consumes half of RAM i.e. 24GB in my case as I have 48 GB of
 physical RAM installed. Can I reduce it to say 8GB? Can it be done? How? Is
 it recommended to reduce tempfs?


Tmpfs size is by default half the size of RAM, but this isn't the used
memory. 24G is the largest size of a single file in tmpfs which itself can
grow or shrink on demand. If you aren't working with files of size +8G,
there is no use of having this large a tmpfs. But, if you have a smaller
tmpfs, it's better to keep a larger swap space, as files are swapped from
tmpfs to disk, which is very slow. To resize, you can edit  /etc/fstab and
include size=8G in the options column. Or, like this:

mount -o remount,size=8G /tmp


Since you have large enough RAM, I'd recommend a large (12G) tmpfs and a
smaller swap (8G), but again this depends on what you're using the machine
for.


 regards,
 Amit Sharma


 Thanks and Regards,
 Amit Sharma

 ___
 Ilugd mailing list
 Ilugd@lists.linux-delhi.org
 http://frodo.hserus.net/mailman/listinfo/ilugd




-- 
-- 
Ankit Chaturvedi
GPG: 05DE FDC5 468B 7D9F 9F45 72F1 F7B9 9E16 ECA2 CC23
http://www.google.com/profiles/ankit.chaturvedi
___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd


Re: [ilugd] Question about SWAP and tempfs

2011-04-25 Thread Rakesh Kumar
[...]
On Mon, Apr 25, 2011 at 12:49 PM, Amit Sharma amit_...@yahoo.com wrote:

 Hi,

 Couple of questions:

 1. SWAP partition must always be 2 x RAM? My machien has 48 GB RAM. I have
 to create 96GB SWAP partition? Isn't 4 GB or 8 GB good enough?

[...]
SWAP partition should be and not must be 2 x RAM. It's a rule of thumb
that you should have this much RAM. Your swap size depends upon the
applications you are gonna use. I agree with Ankit and would suggest that
8-10 GB swap is enough and keep monitoring it.
As i know modern kernels comes with a parameter *swappiness* and it's
parameters varies from 1 to 100. Higher values lead to more pages being
swapped, and lower values lead to more applications being kept in memory,
even if they are idle. By default it's set to 60(not sure) so you can change
it also to see if it fits you.


 2. tempfs consumes half of RAM i.e. 24GB in my case as I have 48 GB of
 physical RAM installed. Can I reduce it to say 8GB? Can it be done? How? Is
 it recommended to reduce tempfs?

regards,
 Amit Sharma


 Thanks and Regards,
 Amit Sharma

 ___
 Ilugd mailing list
 Ilugd@lists.linux-delhi.org
 http://frodo.hserus.net/mailman/listinfo/ilugd




-- 
Regards
RAKESH KUMAR
http://www.openwebtech.in
http://raakeshkumar.wordpress.com
___
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd