Re: [SLUG] Increasing RAM

2009-04-19 Thread Kyle


Daniel Pittman wrote:

Well, at the moment you have RAID 1 under everything except for swap,
which you have on a RAID 0 array.  (Implemented, in this case, through
the Linux kernel balancing swap space use when areas have equal
priority, as your two separate partitions do.)
  
So, how would I perhaps go about setting priority of one SWAP over the 
other?


In that way, based on the fact, I will now have some 6GB RAM in the server,
whatever SWAP _is_ being used, I could ensure is most likely only 
being used
in the one space. Thereby increasing the chances (but still having that 
single POF)

that a crash on one disk _may_not_ completely take down the entire system.


TiA

Kyle
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-19 Thread Daniel Pittman
Kyle k...@attitia.com writes:
 Daniel Pittman wrote:

 Well, at the moment you have RAID 1 under everything except for swap,
 which you have on a RAID 0 array.  (Implemented, in this case, through
 the Linux kernel balancing swap space use when areas have equal
 priority, as your two separate partitions do.)

 So, how would I perhaps go about setting priority of one SWAP over the
 other?

man swapon, find the 'priority' option, and implement in fstab as it
specifies.

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Michael Chesterton


On 18/04/2009, at 10:02 PM, Kyle wrote:


Hi Slug,

I've decided to increase the RAM on my home CentOS server. As best I  
can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or  
was that approx.~ 50% of RAM?


Can someone point me in the direction of an explicit tutorial on how  
I might go about increasing SWAP without destroying data on my other  
partitions please?


Or if I'm actually upping the RAM, should I just not worry about it?


These days there's no hard rules about swap. The old rule was 2 x RAM.

I don't think you mentioned how much ram you had or how big your swap  
was,

but if you aren't running out of swap, you don't need any more.



--

http://chesterton.id.au/blog/
http://barrang.com.au/


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Dean Hamstead
RAM is so cheap now, that if you start using swap heavily people just 
drop in a bit more !


I tend to roughly match swap and memory. At least when i first install.

Dean

Michael Chesterton wrote:


On 18/04/2009, at 10:02 PM, Kyle wrote:


Hi Slug,

I've decided to increase the RAM on my home CentOS server. As best I 
can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or 
was that approx.~ 50% of RAM?


Can someone point me in the direction of an explicit tutorial on how I 
might go about increasing SWAP without destroying data on my other 
partitions please?


Or if I'm actually upping the RAM, should I just not worry about it?


These days there's no hard rules about swap. The old rule was 2 x RAM.

I don't think you mentioned how much ram you had or how big your swap was,
but if you aren't running out of swap, you don't need any more.




--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Amos Shapira
I used to keep around large swap partitions (that was also before the
blissful days of LVM2) until someone on the linux-il mailing list
convinced me that the amount of overhead for the kernel to keep track
of large amount of swap will actually cause a slow down and reduction
of ram utilization.
Also remember that the 2X or so rule was from Unix days when the
memory management algorithms where totally different (e.g. Each ram
page had a shadow swap page pre-allocated for it).

So now I stick to around .5 gig, whatever the ram size is.

-Amos

On 4/18/09, Dean Hamstead d...@fragfest.com.au wrote:
 RAM is so cheap now, that if you start using swap heavily people just
 drop in a bit more !

 I tend to roughly match swap and memory. At least when i first install.

 Dean

 Michael Chesterton wrote:

 On 18/04/2009, at 10:02 PM, Kyle wrote:

 Hi Slug,

 I've decided to increase the RAM on my home CentOS server. As best I
 can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or
 was that approx.~ 50% of RAM?

 Can someone point me in the direction of an explicit tutorial on how I
 might go about increasing SWAP without destroying data on my other
 partitions please?

 Or if I'm actually upping the RAM, should I just not worry about it?

 These days there's no hard rules about swap. The old rule was 2 x RAM.

 I don't think you mentioned how much ram you had or how big your swap was,
 but if you aren't running out of swap, you don't need any more.



 --
 SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
 Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


-- 
Sent from my mobile device
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Daniel Pittman
Kyle k...@attitia.com writes:

 I've decided to increase the RAM on my home CentOS server. As best I
 can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or
 was that approx.~ 50% of RAM?

As others have said, this was true back in the days when 64MB was a lot
of memory.  Now, by the time you are 8GB deep into swap you have spent
an awful lot of time thrashing...

 Can someone point me in the direction of an explicit tutorial on how I
 might go about increasing SWAP without destroying data on my other
 partitions please?

With fixed partitions, which you seem to use — although you didn't
specify the details — life is pretty hard.

Do you actually have some unpartitioned space?  If not, then forget
about repartitioning.  If you do, is it next to the existing swap
partitions or is it elsewhere?


Anyway, if you just want to add swap then swapping to a file is as
efficient, these days, as swapping to a raw device.[1]  Just use one of
them instead if repartitioning is hard.

 Or if I'm actually upping the RAM, should I just not worry about it?

I wouldn't bother.  Anyway, a couple of comments:

First, this would be vastly easier if you used LVM, since that makes
allocating space on the fly a universe easier.  Also:

 Info I'm guessing would be relevant;

 [k...@bottlenose ~]$ cat /etc/fstab
 /dev/md1/   ext3defaults1 1
 /dev/md2/boot   ext3defaults1 2

Are these RAID 0 or RAID 1?  If they are RAID 1 then this ...

 LABEL=SWAP-sdb2 swapswapdefaults0 0
 LABEL=SWAP-sda2 swapswapdefaults0 0

... means that your system will fail when a disk goes bad; you probably
want to match the RAID setup underneath your swap to the setup
underneath your data devices.

Regards,
Daniel

Footnotes: 
[1]  Technically, since a raw device is only ever one extent and a file
 may be several it is a few hundred bytes more efficient, I suppose.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Daniel Pittman
Amos Shapira amos.shap...@gmail.com writes:

 I used to keep around large swap partitions (that was also before the
 blissful days of LVM2) until someone on the linux-il mailing list
 convinced me that the amount of overhead for the kernel to keep track
 of large amount of swap will actually cause a slow down and reduction
 of ram utilization.

You were, I fear, convinced of something untrue.  There is no
substantial overhead to tracking a large amount of swap, and certainly
no reduction of ram utilization.

Linux memory management is not /that/ bad, honest. ;)


What they may have been talking about is that having swapped two or
three gigabytes of memory usually implies that you will be thrashing,
where swapping a few tens or hundreds of megabytes would, historically,
be less certain.

 Also remember that the 2X or so rule was from Unix days when the
 memory management algorithms where totally different (e.g. Each ram
 page had a shadow swap page pre-allocated for it).

Actually, this has varied across Unix implementations for a range of
reasons; under Linux it was historically that way.

 So now I stick to around .5 gig, whatever the ram size is.

*nod*  As do I, save in the one case where I want to be able to use the
suspend to disk functions supported by Linux.

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Kyle

First, this would be vastly easier if you used LVM, since that makes
allocating space on the fly a universe easier.  


Re LVM;

Maybe, but the last machine I had I ran LVM. I had a hard enough time 
remembering which volume belonged to which group belonged to which disk 
(and that despite naming them along the lines of; 'lv00Grp00Hda1', 
'lv01Grp00Hda1'). So this time I figured I'd simplify my life somewhat. 
I have all the necessary conf and data files, etc regularly backed up so 
if it does go down, it shouldn't be TOO MUCH hassle to get it all back.


It is RAID 1.  And if I understand Daniel correctly;

... you probably want to match the RAID setup underneath your swap to 
the setup underneath your data devices. ..


You mean I should have the swap spread across the RAID as well. I'm 
pretty certain that how it is as the m'board controls the RAID of the 2 
disks. I just installed on the one array for the OS.  Either way, it's 
too late now.


In short, on the advice of all, I just wont bother with increasing SWAP. 
I'll just dump in the RAM and see what happens.


What's bugging me more now is trying to get bloody Ubuntu to recognise 
and operate my old Linksys-Broadcom Wireless PCI card. But that's a 
whole nother story.



Kindc Regards

Kyle

Daniel Pittman wrote:

Kyle k...@attitia.com writes:

[k...@bottlenose ~]$ cat /etc/fstab
/dev/md1/   ext3defaults1 1
/dev/md2/boot   ext3defaults1 2
  


Are these RAID 0 or RAID 1?  If they are RAID 1 then this ...

  

LABEL=SWAP-sdb2 swapswapdefaults0 0
LABEL=SWAP-sda2 swapswapdefaults0 0



... means that your system will fail when a disk goes bad; you probably
want to match the RAID setup underneath your swap to the setup
underneath your data devices.

Regards,
Daniel

  

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread jam
On Sunday 19 April 2009 00:16:35 slug-requ...@slug.org.au wrote:
 I've decided to increase the RAM on my home CentOS server. As best I can
 recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or was
 that approx.~ 50% of RAM?

 Can someone point me in the direction of an explicit tutorial on how I
 might go about increasing SWAP without destroying data on my other
 partitions please?

 Or if I'm actually upping the RAM, should I just not worry about it?

 Info I'm guessing would be relevant;

Of course this is cockamany, urban myth, etc and typically you increase RAM 
and need even less swap than before
for eg (my desktop)
Mem:   4036296k total,  4014656k used,21640k free,96400k buffers
Swap:  1004020k total,   32k used

EXCEPT for 1 tragic circumstance: Never *suspend* unless you have as much SWAP 
as RAM. Suspend writes all RAM starting at the beginning of swap and over 
everything along the way. (and I activated suspend by dropping an earring on 
the keyboard :-)

So if your use scenario has never used all your swap, add RAM and forget about 
adding swap otherwise do the math

James
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Daniel Pittman
Kyle k...@attitia.com writes:

 First, this would be vastly easier if you used LVM, since that makes
 allocating space on the fly a universe easier.

 Re LVM;

 Maybe, but the last machine I had I ran LVM. I had a hard enough time
 remembering which volume belonged to which group belonged to which
 disk (and that despite naming them along the lines of;
 'lv00Grp00Hda1', lv01Grp00Hda1').

My immediate response to that is why would you bother?

The only case I can think of where it would matter are wanting to have
specific partitions on specific disk sets, for performance, which you
can rediscover fairly easily if you actually need to.

I also note that you don't seem to have enough disks in this machine to
make that a concern.


Presumably, though, I have missed something, since you obviously had
reasons for wanting to know that information.  Could you explain them,
because I would like to understand what I, um, don't understand. :)


 So this time I figured I'd simplify my life somewhat. I have all the
 necessary conf and data files, etc regularly backed up so if it does
 go down, it shouldn't be TOO MUCH hassle to get it all back.

LVM is only a convenience saver, not a backup of any sort, so this would
be good practice anyway.


 It is RAID 1.  And if I understand Daniel correctly;

 ... you probably want to match the RAID setup underneath your swap to
 the setup underneath your data devices. ..

 You mean I should have the swap spread across the RAID as well.

Well, at the moment you have RAID 1 under everything except for swap,
which you have on a RAID 0 array.  (Implemented, in this case, through
the Linux kernel balancing swap space use when areas have equal
priority, as your two separate partitions do.)

That also means that when a disk fails it will potentially take out a
block of swap with no recourse, and that you will have to manually swap
off the physical device to replace it.


 I'm pretty certain that how it is as the m'board controls the RAID of
 the 2 disks. I just installed on the one array for the OS.  Either
 way, it's too late now.

It isn't, really: you could just turn those two swap partitions into a
software RAID array like the rest of your data, but RAID 1 rather than
RAID 0. :)

 In short, on the advice of all, I just wont bother with increasing
 SWAP. I'll just dump in the RAM and see what happens.

That shouldn't be a big drama.

 What's bugging me more now is trying to get bloody Ubuntu to recognise
 and operate my old Linksys-Broadcom Wireless PCI card. But that's a
 whole nother story.

You might want to post the details somewhere, see if someone can help. :)

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Daniel Pittman
jam j...@tigger.ws writes:
 On Sunday 19 April 2009 00:16:35 slug-requ...@slug.org.au wrote:

 I've decided to increase the RAM on my home CentOS server. As best I
 can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or
 was that approx.~ 50% of RAM?

 Can someone point me in the direction of an explicit tutorial on how
 I might go about increasing SWAP without destroying data on my other
 partitions please?

 Or if I'm actually upping the RAM, should I just not worry about it?

 Info I'm guessing would be relevant;

 Of course this is cockamany, urban myth, etc and typically you
 increase RAM and need even less swap than before

Actually, back in the day this was a good and solid guide, both for
performance and safety reasons.  Today, less so, but I don't think it is
quite as laughable or untrue as you suggest.

[...]

 EXCEPT for 1 tragic circumstance: Never *suspend* unless you have as
 much SWAP as RAM.

You mean suspend to disk, not suspend to RAM, right?  Swap is irrelevant
to the later, and the amount you need varies with which of the three
implementations of the former you choose.

However, all of them require as much swap as you have *active memory*,
not as much as RAM — although, obviously, if you have no discardable
pages[1] then you need the two to be equal.

 Suspend writes all RAM starting at the beginning of swap and over
 everything along the way.

No, it doesn't.  It uses the swap storage space just like the normal
kernel, except for adding some private accounting information and a
different header to make it possible to detect that it was used to
suspend to disk.

If it behaved as you describe[2] then it would corrupt memory on the way
through as it overwrote swapped data (and, then, no one would ever
report a successful suspend to disk. :)

Regards,
Daniel

Footnotes: 
[1]  You do, in the form of all executable code, disk backed memory
 mappings, disk cache and so forth.  In fact, it is quite rare that
 discardable memory doesn't represent a substantial portion of your
 used memory, even if swap is in use.

[2]  Excluding the obvious circumstance of bugs in the suspend software
 that cause it to create serious corruption, which you may have
 encountered, especially with the more experimental versions.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Kyle


Daniel Pittman wrote:

Kyle k...@attitia.com writes:
  

Maybe, but the last machine I had I ran LVM. I had a hard enough time
remembering which volume belonged to which group belonged to which
disk (and that despite naming them along the lines of;
'lv00Grp00Hda1', lv01Grp00Hda1').


My immediate response to that is why would you bother?
  
Being anal. Plus I was new to LVM at the time. 


The only case I can think of where it would matter are wanting to have
specific partitions on specific disk sets, for performance, 
  

exactly. That and local backups.


Well, at the moment you have RAID 1 under everything except for swap,
which you have on a RAID 0 array.  (Implemented, in this case, through
the Linux kernel balancing swap space use when areas have equal
priority, as your two separate partitions do.)
  

Hmmm. If I think about it... My logic at the time would probably have been;

If one disk in the array fails, then all data is mirrored. 
Yes, the machine might crash and if it had anything in SWAP at that time,

I would lose that information.  Acceptable risk.
However, with a single mirrored disk, and still a complete SWAP partition,
I expected I would be able to restart and function on the one disk 
temporarily

until such point in time as I was to rebuild the mirror.

Are you saying that wouldn't work?


It isn't, really: you could just turn those two swap partitions into a
software RAID array like the rest of your data, but RAID 1 rather than
RAID 0. :)
  

Ok. So how do I do that? But are you sure my logic above isn't sound?

TiA.

K
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread jam
On Sunday 19 April 2009 10:00:03 slug-requ...@slug.org.au wrote:
  On Sunday 19 April 2009 00:16:35 slug-requ...@slug.org.au wrote:
  I've decided to increase the RAM on my home CentOS server. As best I
  can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or
  was that approx.~ 50% of RAM?
 
  Can someone point me in the direction of an explicit tutorial on how
  I might go about increasing SWAP without destroying data on my other
  partitions please?
 
  Or if I'm actually upping the RAM, should I just not worry about it?
 
  Info I'm guessing would be relevant;
 
  Of course this is cockamany, urban myth, etc and typically you
  increase RAM and need even less swap than before

 Actually, back in the day this was a good and solid guide, both for
 performance and safety reasons.  Today, less so, but I don't think it is
 quite as laughable or untrue as you suggest.

From the days of my first system (PDP11, 100K RAM, 15MB disk) till today I 
cannot see why this opinion is held. I first encounted it as a RedHat 
recommendation. Pray wax lyrical ...

  EXCEPT for 1 tragic circumstance: Never *suspend* unless you have as
  much SWAP as RAM.

 You mean suspend to disk, not suspend to RAM, right?  Swap is irrelevant
 to the later, and the amount you need varies with which of the three
 implementations of the former you choose.

 However, all of them require as much swap as you have *active memory*,
 not as much as RAM — although, obviously, if you have no discardable
 pages[1] then you need the two to be equal.

If your active RAM is not equal to physical RAM then the systems is not doing 
ir right (your definition of active ram ?)

  Suspend writes all RAM starting at the beginning of swap and over
  everything along the way.

 No, it doesn't.  It uses the swap storage space just like the normal
 kernel, except for adding some private accounting information and a
 different header to make it possible to detect that it was used to
 suspend to disk.

OK it starts SOMEWHERE in swap then writes over everything. In any event I 
lost my home partition (root swap home)

 If it behaved as you describe[2] then it would corrupt memory on the way
 through as it overwrote swapped data (and, then, no one would ever
 report a successful suspend to disk. :)

I never use any suspend and clearly don't appreciate the fine detail, but how 
would this ever work

1G RAM
2G swap

VasttExtravagentApp using 1.9G of swap, then suspend-to-disk?

James
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread Daniel Pittman
jam j...@tigger.ws writes:
 On Sunday 19 April 2009 10:00:03 slug-requ...@slug.org.au wrote:
  On Sunday 19 April 2009 00:16:35 slug-requ...@slug.org.au wrote:
  I've decided to increase the RAM on my home CentOS server. As best I
  can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or
  was that approx.~ 50% of RAM?
 
  Can someone point me in the direction of an explicit tutorial on how
  I might go about increasing SWAP without destroying data on my other
  partitions please?
 
  Or if I'm actually upping the RAM, should I just not worry about it?
 
  Info I'm guessing would be relevant;
 
  Of course this is cockamany, urban myth, etc and typically you
  increase RAM and need even less swap than before

 Actually, back in the day this was a good and solid guide, both for
 performance and safety reasons.  Today, less so, but I don't think it
 is quite as laughable or untrue as you suggest.

 From the days of my first system (PDP11, 100K RAM, 15MB disk) till
 today I cannot see why this opinion is held. I first encounted it as a
 RedHat recommendation. Pray wax lyrical ...

Sure.  First of all, some of this wisdom comes from other Unix kernels,
under which virtual memory management was handled quite differently, and
in which it was necessary for the system to preallocate backing store in
swap for all pages in use.

Second, it also comes from back in the 2.0 through 2.4 era, before the
big MM rewrite, under which allocating sufficient swap was significantly
helpful to various operations — it meant that the kernel could manage
memory more efficiently.

Finally, back when a machine with 32MB of RAM was big it was quite
conceivable that you would run multiple activities with a combined
working set much larger than available memory.

Allowing those to swap deeply, when they were not concurrent, meant that
you could handle a good deal more context with reasonable performance.
Sure, an ideal system wouldn't swap, but a common one would — especially
at the hobbiest end of the market.


Oh, and it is still possible today to set a strict overcommit mode under
Linux, ensuring that every page of allocated anonymous memory has
allocated a page of backing store in swap — this works well for ensuring
that applications never receive a late out of memory error due to
other applications stealing the overcommitted pages from them, at the
cost of working poorly with applications that allocate vast chunks of
unused virtual memory.

  EXCEPT for 1 tragic circumstance: Never *suspend* unless you have as
  much SWAP as RAM.

 You mean suspend to disk, not suspend to RAM, right?  Swap is irrelevant
 to the later, and the amount you need varies with which of the three
 implementations of the former you choose.

 However, all of them require as much swap as you have *active memory*,
 not as much as RAM — although, obviously, if you have no discardable
 pages[1] then you need the two to be equal.

 If your active RAM is not equal to physical RAM then the systems is
 not doing ir right (your definition of active ram ?)

Pages that are not discardable, mostly consisting of anonymous memory.
Unmodified page cache, for example, is valuable but not active in this
sense.  Perhaps not the best choice of term on my part, though. :)


  Suspend writes all RAM starting at the beginning of swap and over
  everything along the way.

 No, it doesn't.  It uses the swap storage space just like the normal
 kernel, except for adding some private accounting information and a
 different header to make it possible to detect that it was used to
 suspend to disk.

 OK it starts SOMEWHERE in swap then writes over everything. In any
 event I lost my home partition (root swap home)

You found an amazingly serious bug; which variant of suspend was this
with (or which distribution and release, from which I can derive that?)

Anyway, the suspend code is *supposed* to use the standard interface to
the swap space, or just the swap space directly, and will not run
outside of that space in normal use.


 If it behaved as you describe[2] then it would corrupt memory on the
 way through as it overwrote swapped data (and, then, no one would
 ever report a successful suspend to disk. :)

 I never use any suspend and clearly don't appreciate the fine detail,
 but how would this ever work

 1G RAM
 2G swap

 VasttExtravagentApp using 1.9G of swap, then suspend-to-disk?

... think, think, think, fail the suspend process with an error because
sufficient swap space cannot be found.

In other words: this is an error condition, under which normal error
reporting should happen and the suspend will not run.

The general algorithm of all the suspend implementations is to discard
pages until suspend can happen — any discardable pages without concern
for swsusp and uswsusp, and as few as possible for TuxOnIce.

Then, write what remains to swap, then shut down.  If we can't fit
everything in swap handle the error gracefully.

Regards,
Daniel
--
SLUG - 

Re: [SLUG] Increasing RAM

2009-04-18 Thread Daniel Pittman
Kyle k...@attitia.com writes:
 Daniel Pittman wrote:
 Kyle k...@attitia.com writes:

 Maybe, but the last machine I had I ran LVM. I had a hard enough time
 remembering which volume belonged to which group belonged to which
 disk (and that despite naming them along the lines of;
 'lv00Grp00Hda1', lv01Grp00Hda1').

 My immediate response to that is why would you bother?

 Being anal. Plus I was new to LVM at the time. 

*nod*  OK, that helps explain why. :)

 The only case I can think of where it would matter are wanting to have
 specific partitions on specific disk sets, for performance,
 exactly. That and local backups.

Mmmm.  Local backups?  As in, add another disk and use it as the backup
target?  That is reasonable.

 Well, at the moment you have RAID 1 under everything except for swap,
 which you have on a RAID 0 array.  (Implemented, in this case, through
 the Linux kernel balancing swap space use when areas have equal
 priority, as your two separate partitions do.)

 Hmmm. If I think about it... My logic at the time would probably have been;

 If one disk in the array fails, then all data is mirrored. Yes, the machine
 might crash and if it had anything in SWAP at that time,
 I would lose that information.  Acceptable risk.

 However, with a single mirrored disk, and still a complete SWAP
 partition, I expected I would be able to restart and function on the
 one disk temporarily until such point in time as I was to rebuild the
 mirror.

 Are you saying that wouldn't work?

No, that will work as you state: a crash will potentially take your
system down, recovery will be fine.  If you have accepted that trade-off
then all is well.

A surprising number of people /don't/ consider that, and can't afford to
have the system go down, but still use RAID-0 swap. :)

Regards,
Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Increasing RAM

2009-04-18 Thread peter
 jam == jam  j...@tigger.ws writes:

jam On Sunday 19 April 2009 10:00:03 slug-requ...@slug.org.au wrote:
 On Sunday 19 April 2009 00:16:35 slug-requ...@slug.org.au wrote: 
 I've decided to increase the RAM on my home CentOS server. As best
 I  can recall, the accepted wisdom is to have SWAP approx.~ 2 x
 RAM. Or  was that approx.~ 50% of RAM?
 
  Can someone point me in the direction of an explicit tutorial on
 how  I might go about increasing SWAP without destroying data on
 my other  partitions please?
 
  Or if I'm actually upping the RAM, should I just not worry about
 it?
 
  Info I'm guessing would be relevant;
 
  Of course this is cockamany, urban myth, etc and typically you 
 increase RAM and need even less swap than before
 
 Actually, back in the day this was a good and solid guide, both for
 performance and safety reasons.  Today, less so, but I don't think
 it is quite as laughable or untrue as you suggest.

jam From the days of my first system (PDP11, 100K RAM, 15MB disk)
jam till today I cannot see why this opinion is held. I first
jam encounted it as a RedHat recommendation. Pray wax lyrical ...

Standard (i.e., Edition 7 and later) unices used to write all their
memory into the swap partition on crash, along with some headers.
Then when you booted the system, the early code would recognise that
the swap partition was full of a memory image, and offer to dump it to
tape (or, for Kodak Unix, to 8 floppies!).  Then after you'd booted
and fscked, you could load the image into a file, and use the
crash(8) utility on it to find out why the kernel crashed.

For all this to work, you needed a bit more swap than you had RAM ---
and two times would always be enough (and it was a good enough rule of
thumb that made its way into the SCO system administrator's course ---
in the days when machine prices started coming down, and instead of a
central system, companies were putting in small servers here there and
everywhere; quite often the admin assistant or receptionist would be
sent on a course to learn how to set up or administer the thing.  I
remember giving courses in 1986--8 and they were full of women who'd
been told off to learn how to use and administer `the computer'.  I
taught them vi and troff (word processing) how to install, partition,
and format discs, add users, use chmod, use printers, set up serial
ports for terminals, etc (all the admin stuff) in three days!!! At
least they could generally type.  Niceties such as working out exactly
how much swap you needed were way too complex, so we told them, twice
your RAM)

Peter C
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html