store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Fri May 24, 2013 11:35 am

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic Share/Bookmark  [ 3 posts ] 
Author Message
 Post subject: swap discussion
Unread postPosted: Mon May 10, 2010 9:54 am 
Offline
Forum Regular
Forum Regular

Joined: Sun Mar 29, 2009 6:52 pm
Posts: 348
Ok. Up today we all used swap I believe in our systems.

But with todays servers do we still need swap ?
For example apart from 1 all my other servers have 4+ gigabyte ram.

I've googled alot and read tons of different opinions. And also OS communities don't give a clear image of if you need or if you dont need swap. And when they say you need swap they only discuss about a machine that has up to 2 giga ram.

So ...

Would you setup swap on a server with 4 gb ram for example ?

And if yes why ?

_________________
Hello IT.
Phone : Blah Blah ....
Have you tried turning it on and off again ?
Phone : Blah Blah ....
....
I'm sorry, are you from the Past ?!
http://www.youtube.com/watch?v=-E4fm4Wqego


Top
 Profile  
 
 Post subject: Re: swap discussion
Unread postPosted: Mon May 10, 2010 11:30 am 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin

Joined: Wed Dec 31, 1969 8:00 pm
Posts: 7429
Location: earth
Yes you need swap, if only to manage some garbage collection on the system. I generally use at least an equal amount of swap to the ram on the system, but as you get to higher and higher amounts this becomes less and less important. More modern kernels also allow you to set the "swapiness" of the system from /etc/sysctl.conf with: vm.swappiness=X, where X is a value 0-100 (default is 60) that determines the swap policy on the system. 0 meaning swap only when you need memory, and 100 being swap out as many unused pages as possible to free up memory.


Top
 Profile  
 
 Post subject: Re: swap discussion
Unread postPosted: Mon May 10, 2010 11:56 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Apr 10, 2006 12:55 pm
Posts: 656
Do you need swap? Yes. Without swap you could have bad things happen. How bad? Well, consider the comic on this page, except that malloc might not be so nice. Swap exists so you can pretend you have more RAM than you have. The cost is performance. Your hard drive is a snail compared to RAM's souped-up motorcycle, so storing RAM to disk is not the best idea but trying to allocate RAM and having your memory manager go "Sorry, all out" could cause mayhem (I don't know exactly what would happen under Linux but why taunt happy fun ball when you don't need to?).

In a normal Linux system, you run pretty close to full usage for performance reasons (being that RAM is so fast and usually abundant). Your virtual memory manager will offload less used blocks of memory to make room for other things that need it short term. This keeps your RAM fresh without needing to destroy anything. A small amount of swap usage is to be expected on any machine.

I would say 512MB - 1GB of swap should be more than sufficient for most systems. A full swap means you've got problems.

_________________
"Its not a mac. I run linux... I'm actually cool." - scott


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic Share/Bookmark  [ 3 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group