1825657 Members
3457 Online
109686 Solutions
New Discussion

Re: Swap size

 
Shahul
Esteemed Contributor

Swap size


Hi,

I am using top to find swap size. Is it the righ way? Or do you know any other command like swapinfo or swap ...etc in linux.

TIA
Shahul
11 REPLIES 11
Matt Palmer_2
Respected Contributor

Re: Swap size

hi you could try 'swapon -s' or catting /proc/swap/xxx/xxx

HTH

bye
Roberto Polli
Trusted Contributor

Re: Swap size

free -m

man free

Peace, R
Martin P.J. Zinser
Honored Contributor

Re: Swap size

Hi,

on my systems it is actually /proc/swaps
containing this information not /proc/swap/xxx

Greetings, Martin
Francisco J. Soler
Honored Contributor

Re: Swap size

Hi,

What about

cat /proc/meminfo

you obtain memory information including the swap.

Frank.
Linux?. Yes, of course.
Alexander M. Ermes
Honored Contributor

Re: Swap size

Hi there.
We ususally take about 1.5 times the total memory size.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Rupesh_7
New Member

Re: Swap size

Towards the safer size make the swap space a multiple of 16 to the nearest twice main memory. Most of the times it will come to about twice RAM.
Steven E. Protter
Exalted Contributor

Re: Swap size

Since we're making recommondations, the real answer is "it depends"

If the server is going to be overloaded and asked to do more than its rated for historically, 2.0 to 2.5 times main memory is as far as you can go with swap.

If you want a server that is very efficient, you can cut it down to 1.5 times main memory.

I've been running a production web server at swap slightly less than main memory for quite some time. I got it with 256 MB and did a 1.0 GB upgrade on it while it was in production. Since it was in production it didn't pay to expand swap for a web server.

So the answer varies.

I will tell you than on an experimental box, I once went 4.0 times RAM. Using that box was like watching grass grow.

You pay your money, you take your choice.

Wasn't this thread originally about how to check swap?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
KapilRaj
Honored Contributor

Re: Swap size

swapon -s # SuSE Linux

Kaps
Nothing is impossible
sam_111
Trusted Contributor

Re: Swap size

hi Shahul,

you can get swap info different commands.

I always try to get info from proc.

cat /proc/swaps
cat /proc/meminfo

vmstat -s will give you a detailed info.

regards,

sam
"Hard Work always Pays off"
Mark Grant
Honored Contributor

Re: Swap size

Hey SEP,

I ran a box without any swap at all for a while (had no choice). Worked fine but then I was fairly certain I wouldn't run out of RAM. Isn't Linux great :)

P.S. No points for this aimless ramble of a post please
Never preceed any demonstration with anything more predictive than "watch this"
Yong_7
Frequent Advisor

Re: Swap size

Hi Mark,

it's linux magic we can live WITHOUT swap.

but I would like to find out the balance point for using swap.

here is info from Linux kernel developers.

http://kerneltrap.org/node/view/3202


Cheers !

YJ