Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Increasing swap
PostPosted: Sun Jun 12, 2011 2:42 am 
Offline
Senior Member

Joined: Fri May 20, 2011 2:45 am
Posts: 63
Location: Spain
After increasing your linode, how would you increase your swap space accordingly? By adding a swap file?


Top
   
 Post subject:
PostPosted: Sun Jun 12, 2011 4:00 am 
Offline
Senior Member

Joined: Tue May 03, 2011 11:55 am
Posts: 105
I know that on mine the swap is actually a disk image. You should be able to resize that disk and then you'll have more space.


Top
   
 Post subject:
PostPosted: Sun Jun 12, 2011 4:26 am 
Offline
Senior Member

Joined: Fri May 20, 2011 2:45 am
Posts: 63
Location: Spain
Yes, I noticed that mine too. So it should be easy to increase, isn't it?


Top
   
 Post subject:
PostPosted: Sun Jun 12, 2011 5:14 am 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 567
Website: http://www.mattnordhoff.com/
It's generally recommended to always use 256 MB of swap, no matter the size of your Linode. Significant swapping is almost always really, really bad; better to OOM earlier without crushing the disks first.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Sun Jun 12, 2011 5:20 am 
Offline
Senior Member

Joined: Fri May 20, 2011 2:45 am
Posts: 63
Location: Spain
Is there an official post for this recommendation?

In https://help.ubuntu.com/community/SwapFaq they say:

Quote:
As a base minimum, it's highly recommended that the swap space should be equal to the amount of physical memory (RAM).


Top
   
 Post subject:
PostPosted: Sun Jun 12, 2011 5:57 am 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 567
Website: http://www.mattnordhoff.com/
fernandoch wrote:
Is there an official post for this recommendation?

http://library.linode.com/getting-started#sph_deploy-a-linux-distribution

I meant recommended by Linode, not by some distro crap. :P

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Sun Jun 12, 2011 6:36 am 
Offline
Senior Member

Joined: Fri May 20, 2011 2:45 am
Posts: 63
Location: Spain
Well, the Ubuntu distro is the most used in Linode.com...

The problem might be having a big swap in a virtual environment like this one, but in a physical server, the swap should be well sized.


Top
   
 Post subject:
PostPosted: Sun Jun 12, 2011 8:40 am 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 567
Website: http://www.mattnordhoff.com/
Being widely-used doesn't mean Ubuntu-related documentation is automatically good.

Shrug. I wasn't very seriously insulting it. You're right, though. I was only thinking in terms of Linode, not the wider use-cases that documentation is written for. In any case, I don't have a position on swap in general; but on Linode, 256 MB plz.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Mon Jun 13, 2011 3:45 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
The 256MB suggestion on some of the larger Linode sizes might not be quite sufficient... I'd tend to suggest max(256, RAM*0.25) as a baseline.

Anyhow, 1:1 ratio of RAM to swap is greatly excessive, be it on a linode or physical server. Desktops are a different story, but for servers, the case for extra swap is pretty poor. Swap is slow. If you need more swap because you don't have enough RAM, adding swap isn't going to solve your problems, it's only going to slow your linode to a crawl.

To put it this way, swap is fine for moving inactive things out of RAM to free up memory. Swap is *NOT* fine for actively running anything. If you're creeping into swap because of insufficient memory rather than because stuff is inactive, you're in for a very bad day.

While I tend to argue that a 512MB linode can handle enormous loads as a basic LLMP/LEMP/etc stack (into the millions of pageviews per day), if you're maxing out your RAM, you're better getting more RAM than more swap.


Top
   
 Post subject:
PostPosted: Mon Jun 13, 2011 3:58 pm 
Offline
Senior Member

Joined: Sat Mar 12, 2011 3:43 am
Posts: 76
Location: Russia
fernandoch wrote:
Well, the Ubuntu distro is the most used in Linode.com...

Ubuntu was designed to become a desktop OS, and for desktop OS it's good advice to set size of swap not less than size of RAM, to use hibernation. But it's not actual for servers.


Top
   
 Post subject:
PostPosted: Mon Jun 13, 2011 4:25 pm 
Offline
Senior Member

Joined: Fri May 20, 2011 2:45 am
Posts: 63
Location: Spain
OZ wrote:
fernandoch wrote:
Well, the Ubuntu distro is the most used in Linode.com...

Ubuntu was designed to become a desktop OS, and for desktop OS it's good advice to set size of swap not less than size of RAM, to use hibernation. But it's not actual for servers.


Oh really? How come Oracle and Redhat have some minimum swap requirements?

http://docs.redhat.com/docs/en-US/Red_H ... ap-what-is

http://download.oracle.com/docs/cd/B193 ... m#sthref63

These are no desktops and no hibernation...


Top
   
 Post subject:
PostPosted: Mon Jun 13, 2011 4:40 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
The RHEL recommendations also state that "the amount of memory in modern systems has increased into the hundreds of gigabytes"... which may be true for a small number of very high-end systems, but I doubt servers with 256GB+ of RAM are all that common.

There are still edge cases where large amounts of swap can be beneficial. Varnish, for example, eschews disk caching, and instead uses swap as a disk cache. My understanding is that it essentially shoves everything in RAM and then lets the OS figure out what stuff is frequently accessed enough to stay in RAM. Perhaps Oracle does something like this. But failing this kind of specific use of swap, the general case doesn't warrant having much of it.


Top
   
 Post subject:
PostPosted: Mon Jun 13, 2011 4:47 pm 
Offline
Senior Member

Joined: Sat Mar 12, 2011 3:43 am
Posts: 76
Location: Russia
fernandoch wrote:
Oh really?

Yes.

fernandoch wrote:
http://download.oracle.com/docs/cd/B19306_01/install.102/b15667/pre_install.htm#sthref63

It's OS recommendations? If you have recommendations for concrete software - it's another case and no reasons to ask this on forum, if you have already strict recommendations.

fernandoch wrote:
These are no desktops and no hibernation...

Oh, really? RHEL has hibernation.

And, if you don't want to listen answers here - why do you asking here? Ask those authors whose recommendations you cite.

You have recommendation from Linode:
Quote:
We strongly recommend sticking with the default swap image size, as allowing your Linode to go heavily into swap can seriously degrade performance in an environment where disk IO is shared among virtual machines.


Top
   
 Post subject:
PostPosted: Mon Jun 13, 2011 5:49 pm 
Offline
Senior Member

Joined: Fri May 20, 2011 2:45 am
Posts: 63
Location: Spain
Of course I do want to listen to answers here, this is why I asked.

No more comments from my side.

Thank you all.


Top
   
 Post subject:
PostPosted: Thu Jun 16, 2011 2:58 am 
Offline
Newbie

Joined: Thu Jun 16, 2011 2:25 am
Posts: 3
Website: http://www.greengecko.co.nz
AOL: steve@greengecko.co.nz
Location: Christchurch, New Zealand
The days of mem = swap are long gone. Those days it was actively used - to store recenty used images for example, but it was the relatively huge price of memory ( nobody will need more than 640KB anybody? ) that started this off.

Nowadays, as others have said, if you are using swap on a regular basis, then you're hurting your system performance, and should be looking at upgrading. The swap's there just in case, and to provide a warning.

Oracle's demands that you have the same swap as memory are the most annoying... why did you install 64GB in the first place??? I just live with it then throw it away when up and running.

Finally, server loads are generally more predictable than a desktop - and Ubuntu provide both, so their recommendations may well be covering both setups as well. Personally, I don't even install a GUI on my servers, let alone run bloatware like firefox... my poor old workstation has to take that, and it has far more mem than most of my linodes!


Steve.


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


Who is online

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