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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-10-2005, 07:01 PM
|
#1
|
Member
Registered: Jun 2005
Posts: 36
Rep:
|
Yet another swap question
I have a server running...and i stupidly forgot to add a swap partition to it when i installed it.
anyways, the hard drive (20 gig) contains one ext3 partition (also 20 gig)
my question is: lets say i run an intensive program that requires a lot of memory (ie 4 gig) . and the server only has 1 gig of physical memory, will the server crash if i run it? or just very slow performance?
solutions:
i do not have physical access to server - if anything goes wrong ... it will take a few days to get access to machine . and any downtime is unacceptable
1) resize the ext3 partition and add/mount a swap partition?
thanks
|
|
|
12-10-2005, 07:34 PM
|
#2
|
Senior Member
Registered: Jun 2004
Posts: 2,553
Rep:
|
yes it will crash
but first it will just run slow
Linux can use a file for swap
Last edited by foo_bar_foo; 12-10-2005 at 07:35 PM.
|
|
|
12-10-2005, 08:12 PM
|
#3
|
Member
Registered: Jun 2005
Posts: 36
Original Poster
Rep:
|
will the server crash? or will the program crash?
|
|
|
12-10-2005, 08:28 PM
|
#4
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,437
|
Indeterminate I would think.
If it's a server, isn't either an unacceptable result ???.
As foo_bar_foo indicated, you can use a file in lieu of a partition for swap. In 2.6 the alledged performance penalty has been rectified. Even if you are on a 2.4 kernel, the penalty would be worth taking.
You have a simple solution that requires no outage - why are you dithering ???.
|
|
|
12-10-2005, 08:53 PM
|
#5
|
Member
Registered: Jun 2005
Posts: 36
Original Poster
Rep:
|
if the program crashes, my core services would not be affected (ie. apache, postfix, etc)
if the server crashes (as in the kernel in whole), my core services would go down with it ... which is bad bad bad
how would i use a file as swap?
create a file such as /swap and mount it just like a swap partition?
also, yes i am using a 2.6 kernel (2.6.14 series i think, or 2.6.13)
|
|
|
12-10-2005, 09:23 PM
|
#6
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,437
|
Quote:
Originally Posted by aznium
if the program crashes, my core services would not be affected (ie. apache, postfix, etc)
|
You wish.
They would look like they have died if it takes something like 20 mins to get a response.
Quote:
how would i use a file as swap?
create a file such as /swap and mount it just like a swap partition?
|
Yep, have a look at tldp, (and the following section). It's old, but still valid - play with the sizes; multiple 2Gig files might be the best option.
|
|
|
12-10-2005, 10:42 PM
|
#7
|
Member
Registered: Jun 2005
Posts: 36
Original Poster
Rep:
|
thanks,
i have successfully created a swap file
to help others, wut i did was:
dd if=/dev/zero of=/swap-space bs=1M count=1024 #create a 1 gig zeroed in file (1megabyte * 1024)
mkswap /swap-space #convert that file to swap space
swapon /swap-space #enable it
that created an swap file of 1024 X 1M or 1 gig swap file
|
|
|
All times are GMT -5. The time now is 03:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|