Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Aug 29, 2012 10:46 pm 
Offline
Junior Member
User avatar

Joined: Sun Jan 22, 2012 1:47 am
Posts: 28
Website: http://www.xpzion7.info
Location: Rosarito
How much swap space to give in linode 512 ?

_________________
;)


Top
   
PostPosted: Wed Aug 29, 2012 11:18 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
As little as possible.

Swap means somethings not configured correctly.

Try 256M and see what happens.

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
PostPosted: Thu Aug 30, 2012 1:36 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
128MB, maybe.

Swap on a desktop and swap on a server are different from a desirability standpoint. A desktop, you might have tons of apps open, and you only use one at a time, so you don't mind if something gets swapped out entirely.

On a server, that's not really the case... There's some benefit to a small amount of swap so that legitimately never used stuff can get swapped out, but you never want to have anything in swap that you might need to swap back into RAM.

Caker normally suggests no swap at all. I tend to suggest a tiny amount for this reason. I think 25% of your VPS RAM is a decent value.


Top
   
PostPosted: Mon Sep 03, 2012 3:45 am 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 569
Website: http://www.mattnordhoff.com/
The Linode manager suggests 256 MB as a default. I see no reason to change it.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
PostPosted: Mon Sep 03, 2012 3:49 am 
Offline
Senior Member

Joined: Tue Feb 19, 2008 10:55 am
Posts: 164
i go by the rule of 50% of your disk space is swap, so 10G for a 512, on my desktop I have 1.5T of swap.


Top
   
PostPosted: Mon Sep 03, 2012 7:55 am 
Offline
Senior Member

Joined: Mon Dec 20, 2010 11:37 pm
Posts: 76
chesty wrote:
i go by the rule of 50% of your disk space is swap, so 10G for a 512, on my desktop I have 1.5T of swap.

Oh my God! :roll:


Top
   
PostPosted: Mon Sep 03, 2012 9:42 am 
Offline
Senior Member

Joined: Sat Nov 13, 2010 3:05 am
Posts: 91
Website: http://www.graq.co.uk
drpks wrote:
chesty wrote:
i go by the rule of 50% of your disk space is swap, so 10G for a 512, on my desktop I have 1.5T of swap.

Oh my God! :roll:

Wholly guacomole :!:


Top
   
PostPosted: Mon Sep 03, 2012 4:39 pm 
Offline
Junior Member
User avatar

Joined: Sun Jan 22, 2012 1:47 am
Posts: 28
Website: http://www.xpzion7.info
Location: Rosarito
chesty wrote:
i go by the rule of 50% of your disk space is swap, so 10G for a 512, on my desktop I have 1.5T of swap.

i disagree, its a lot.

_________________
;)


Top
   
PostPosted: Mon Sep 03, 2012 4:54 pm 
Offline
Junior Member

Joined: Sun May 06, 2012 2:30 pm
Posts: 25
Location: San Diego, California
chesty wrote:
i go by the rule of 50% of your disk space is swap, so 10G for a 512, on my desktop I have 1.5T of swap.

I hope that was a joke :?


Top
   
PostPosted: Mon Sep 03, 2012 5:03 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
There's an old old rule of thumb that says "twice ram == swap". However many people who make that statement don't actually understand why it exists and why it never applies (and never has applied) to Linux.

When it comes to linode, the thing to understand is that if your machine starts to swap then performance will drop through the floor. Most people only hit swap when they've got misconfigured apache/mysql setups and when it starts to swap the whole machine spends time in I/O wait and your machine has, basically, swapped to death. It's not servicing requests!

The linux kernel does like a small amount of swap, even if it doesn't really need it. My linode 512 only has around 70Mbyte of working memory; the rest is all I/O cache. And yet there's 3 Mbyte of swap in use, simply 'cos the kernel thinks it's more efficient to send those pages to disk. They're not paged back in simply 'cos they're never used.

As others have suggested, zero to a couple of hundred Mbyte is appropriate. If you're actively swapping then your linode is too small (or your application is misconfigured) and no amount of additional swap will help.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
PostPosted: Mon Sep 03, 2012 10:18 pm 
Offline
Senior Member

Joined: Tue Feb 19, 2008 10:55 am
Posts: 164
sweh wrote:
There's an old old rule of thumb that says "twice ram == swap". However many people who make that statement don't actually understand why it exists and why it never applies (and never has applied) to Linux.


Oh but it has applied to linux at one stage, if you google the right terms, you will see linus and alan cox both saying swap = 2 x ram on the lkml.

and yes, I was joking about swap = 50% disk.


Top
   
PostPosted: Thu Sep 06, 2012 8:22 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
For linux *desktop* use, which is a completely different scenario. You don't care if it takes your IM client half a second to swap back into RAM when you switch from your browser to your IM, but you do care if you spend half a second swapping on every HTTP request to a web server.

A desktop computer is typically running a ton of different programs, only one of which is actively used at any time. A server typically runs a very small number of programs of which multiple or all are actively used at any time.

Imagine if your linode has to swap PHP out of memory to get MySQL into memory every time your web site does a SQL query... times a hundred for a database-heavy webpage.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users 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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group