LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-05-2007, 06:13 PM   #1
bluethumb
Member
 
Registered: Jan 2006
Distribution: RHEL 4, Scientific Linux, Centos, Ubuntu
Posts: 58

Rep: Reputation: 15
Question swapon of 32 GB causes slow boot


We have a computer with 16 GB of memory and 32 GB of swap. When it boots, swapon -a takes about 5 minutes (subjective estimate) to complete. This is really annoying. It's running RHEL 4.

# swapon -s
Filename Type Size Used Priority
/dev/sda2 partition 2096472 0 -1
/swap1 file 10485752 0 -2
/home/swap2 file 20971512 0 -3

I had to split up the swap space because the users kept demanding more of it after everything was installed.

Is there some way to speed up the operation of swapon? I haven't seen anything useful in the man pages.

If not, I wonder if there is some way to postpone the processing of the two swap files until later. If we could get the Gnome desktop and user logins working, then it would be OK to have swapon grinding away for a few minutes.

Has anyone done something like this?
 
Old 12-05-2007, 06:30 PM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
32 gb of swap is insane, so is 16 gb of ram
 
Old 12-05-2007, 06:41 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
If it's a server why are you re-booting at all ???.

Deadrat have patched mkswap to allow swap extents greater than 2 Gig. I did look at the source for swapon a while back, and I think it validates each slot in the space map (been a while since I looked though). Could be getting confused by the big extent.

The easiest way would be to remove the swap entries from fstab - be aware of suspend issues; check the boot options. Later on do the swapon.
 
Old 12-06-2007, 01:33 AM   #4
bluethumb
Member
 
Registered: Jan 2006
Distribution: RHEL 4, Scientific Linux, Centos, Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
Question Thanks, but I have more questions.

Quote:
The easiest way would be to remove the swap entries from fstab - be aware of suspend issues; check the boot options. Later on do the swapon.
I'm scratching my head over how to do this. I could create an initscript to do the swapon in level 5, but I think it would still wait before starting gdm. Could I make it a background task? Or is there some other way to accomplish this? I've never been brave enough to touch inittab.

Possibly related issue: I've been trying to figure out who runs rc.local and when in RHEL4. It's not called in /etc/rc*, nor is it mentioned in inittab. There's no man page for it.

Quote:
Deadrat have patched mkswap to allow swap extents greater than 2 Gig. I did look at the source for swapon a while back, and I think it validates each slot in the space map (been a while since I looked though). Could be getting confused by the big extent.
My swapon -s output shows that it's happy with swap files of 20 GB. That may be because it's a 64-bit system. Does anyone know about the issue of large extents causing confusion?

Quote:
32 gb of swap is insane, so is 16 gb of ram
This computer was bought to run a number-crunching application. It's a coupled system of about 100 diffusion equations on a 3-dimensional grid. In its original state it would fill all the available memory, run for a week, and overfill 12 GB of swap. They recently hired a young guy who actually knows something about programming. He's been squashing bugs and abolishing sloppy programming practices. He claims that he has reduced the memory use by a factor of 5 and more than doubled the speed. I should probably check to see if this much swap is still needed.
 
  


Reply

Tags
rhel4, swapon


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
-How to activate "swapon" at boot in F7 ? el amigo* Fedora 13 06-21-2007 06:49 AM
slow to boot, slow dns resolution after host name change FC5 edavis6678 Linux - Newbie 3 01-03-2007 06:26 PM
Swap does not mount at boot time, swapon is fine after booting jpdm Fedora 3 09-23-2006 10:24 PM
swapon on ntfs willy_9 Linux - Newbie 4 10-25-2005 09:37 AM
mount a partition and swapon on boot(fstab??) edman007 Linux - Newbie 4 10-01-2003 05:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:58 AM.

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
Open Source Consulting | Domain Registration