LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-07-2009, 01:08 AM   #1
vinay_ks
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Rep: Reputation: 0
Smile Increasing Swap Space


hi,

I am vinay working has system administrator.

We have one desktop converted server with linux OS, due to some application issue, we have increased the RAM capacity from 1GB to 2GB.
Now how to increase the SWAP size to 4GB from 2GB.

Please provide me the steps.

Thanks & Regards,
Vinay

Last edited by vinay_ks; 07-07-2009 at 01:09 AM.
 
Old 07-07-2009, 01:12 AM   #2
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51
http://www.cyberciti.biz/faq/linux-a...ap-file-howto/
 
Old 07-07-2009, 01:18 AM   #3
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
Assuming your existing swap is in the form of a swap partition and you can afford an hour or two of downtime, your best bet is to boot some sort of Linux live CD or live flash drive and run gparted. (You can't resize mounted partitions, so you can't do it from your installed Linux.) The developers of that program actually have a live image for just that purpose - get it at gparted.sourceforge.net.

Once you're running gparted, it gives you a graphical view of your partitions. This job is as simple as selecting the one you want to shrink, telling it to take 2 GB off, and then, after that's done, resizing the swap partition to 4 GB. Reboot and everything should be as you want it.
 
Old 07-07-2009, 08:39 AM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by vinay_ks View Post
due to some application issue, we have increased the RAM capacity from 1GB to 2GB.
Now how to increase the SWAP size to 4GB from 2GB.
Have you made an informed decision about whether you have any real reason to increase swap size?

If you are following some arbitrary formula that says swap size should be double ram size, that formula was nonsense and is no reason to change your swap size.

What kind of application issue motivated the increase in ram size? Was the server previously OK, and if so, how big was the change as it became no longer OK?

If there was only a moderate change in requirements, and the increase in ram was motivated by programs swapping too much and getting slow, then the old 2GB swap space is probably fine.

If you increased the number or size of applications to use more than 30% additional total virtual memory (beyond when the server was last OK) then maybe you do need more swap space.

If you already increased the RAM and the system is working, you can easily check whether it needs more swap space by looking at the stats on use of swap space.

If it isn't inconvenient to repartition as Karamarison described and your not tight enough on disk space for 2GB to matter, then maybe you want to just increase swap space rather and worry about whether you really need to. But I expect the inconvenience of repartitioning is large enough to justify some thought about whether you need it.

Last edited by johnsfine; 07-07-2009 at 08:42 AM.
 
Old 07-07-2009, 09:56 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,644
Blog Entries: 27

Rep: Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012Reputation: 2012
Hi,

Quote:
Originally Posted by johnsfine View Post
<snip>

If you are following some arbitrary formula that says swap size should be double ram size, that formula was nonsense and is no reason to change your swap size.

What kind of application issue motivated the increase in ram size? Was the server previously OK, and if so, how big was the change as it became no longer OK?

<snip>
The basic rule is antiquated but applicable when needed to utilize swap relative to the load on the kernel. It's just that with memory available today the need for swap is not always necessary. If your doing heavy computation or large loads then a swap maybe required. Sure to double from 2GB is absurd unless that system indeed needs the larger swap. What about video editing, 3D CAD rendering or even animation? The list could go on.
 
Old 07-07-2009, 11:27 AM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
You can always create a swap file, those are more dynamic than fixed-size swap partitions. They used to incur a performance penalty but Linus Torvalds himself has argued that this is not true any longer.
 
Old 07-07-2009, 01:46 PM   #7
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
Jay, would you happen to have a source for that? I'm not doubting you; just interested and would like to see it myself.

Edit: Found something equivalent - if anyone else is interested, check out http://lkml.org/lkml/2005/7/7/326.

Last edited by karamarisan; 07-07-2009 at 02:07 PM.
 
Old 07-07-2009, 01:52 PM   #8
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Well, the first one I could come up with; not Linus but not bad as an authority either:
http://lkml.org/lkml/2005/7/7/326
 
Old 07-07-2009, 02:09 PM   #9
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
Heh, nice. Yeah, that's good enough for me - makes you wonder why anyone would use a swap partition anymore.
 
Old 07-07-2009, 02:22 PM   #10
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by karamarisan View Post
Yeah, that's good enough for me - makes you wonder why anyone would use a swap partition anymore.
Apparently an authority I ought to recognize. I don't, but I wouldn't change my mind if I did. I'm not very trusting of authorities.

On this topic:

1) I'm not really convinced about performance. It ought to take more data to keep track of the mapping of a swap file that might be pretty contiguous if you're lucky and you allocate it when the file system is young, vs. a partition that is contiguous.

2) During repair operations and major upgrades, it may be very convenient to have the swap space outside of any specific file partition. Since I don't use suspend to disk, I can use the same swap partition from a liveCD even when I want all my file partitions read only or under repair and I can use the same swap partition from every Linux system that I multi boot, again even if the other file partitions aren't mounted.
 
Old 07-07-2009, 03:09 PM   #11
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
He's one of the main kernel developers. That said, there's no reason you should have to take him on authority alone here - he provides an argument. If current kernels just go around the filesystem and start accessing disk blocks directly, where do you think the performance hit is introduced? A partition may be guaranteed to be contiguous, but it still needs to be addressed as a series of blocks. We're making no promises about what happens if your swap file is all over the disk, and if it is, I believe there is such a thing as a Linux defragmenter.

An environment where you want multiple OSs to share swap space without having to share partitions is a good argument for partitions - doesn't apply to any machine I'm currently in charge of, but I'll think of this if that changes. That said, RAM is cheap these days - I've got at least one system that just does not need swap at all. You gotta love how fast technology advances. : )
 
Old 07-13-2009, 07:16 AM   #12
vinay_ks
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Smile NIS

Hi Johnsfine,

I got the answer from the below link, thanks for your suggestions.

http://dhavalv.wordpress.com/2007/11...managing-tool/

Now i have another problem, i tried to configured NIS Server on RHEL 5 Enterprise, i have configured it has well. Now it is giving Error : Listening for an NIS domain Server.................

Kindly help me in resolving this issue.........

Thanks & Regards
K.S.Vinay Kumar

The basic rule is antiquated but applicable when needed to utilize swap relative to the load on the kernel. It's just that with memory available today the need for swap is not always necessary. If your doing heavy computation or large loads then a swap maybe required. Sure to double from 2GB is absurd unless that system indeed needs the larger swap. What about video editing, 3D CAD rendering or even animation? The list could go on. [/QUOTE]
 
Old 07-13-2009, 07:31 AM   #13
maniannam
Member
 
Registered: Dec 2007
Location: India
Distribution: fedora 11
Posts: 64

Rep: Reputation: 15
Hi vinay_ks,

If you have another question, then please create new thread. This is my kind information.

Well, First you should check the server reachability. Then check the "rpcinfo -p <server ip>"

Regards,
maniannam
 
Old 07-13-2009, 07:36 AM   #14
vinay_ks
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Hi,

I have configured NIS Server on RHEL 5 Enterprise. Now it is giving
Error : Listening for an NIS domain Server.................

Kindly help me in resolving this issue.........

Thanks & Regards
K.S.Vinay Kumar
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
increasing swap space in SUSE Enterprise Server 10 Sergei Z Linux - Newbie 5 06-01-2007 09:13 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM
deleting/resizing swap partition / increasing hd space saranga2000 Linux - Hardware 1 12-09-2004 10:03 AM
Increasing swap space rupesh_pulikool Linux - Networking 1 09-12-2004 10:40 PM
increasing the swap space after installing linux LinToWinWin Linux - Newbie 4 08-03-2004 09:51 PM


All times are GMT -5. The time now is 10:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration