[ale] adding swap? was "that same darn NFS problem SOLVED"
Jeff Hubbs
hbbs at attbi.com
Mon Feb 17 19:48:23 EST 2003
This does sound like just inordinate swap usage. However, given that
that's the case...
One of the first things that needs to happen is that you need to max out
the physical RAM. It's silly to worry about your swap I/O until you've
done that.
Once you've maxed out on RAM, however, attention should be paid to 1)
getting swap disk I/O separated from all other disk I/O and 2) making
the swap disk I/O as fast and efficient as possible.
If your server has a hardware RAID controller - not one of the cheapie
IDE ones that are actually performing the RAID in the driver but an
honest-to-goodness SCSI RAID controller - then swap needs to get onto
its own bus (in the case of a multichannel card) or its own card. Don't
configure a swap array on such a card as RAID 5; you don't want the
parity calculations to slow you down
Only if you have a proper RAID controller should you attempt to put swap
on a RAID array. There is not much point to using kernel RAID for swap;
for one thing, if you create more than one swap partition and set them
up properly in /etc/fstab, the kernel will use them in a RAIDlike
capacity, however, in fstab there is a priority setting that is useful
when you're working with cobbled-together junk like I usually do. In any
case, the point of the exercise is to separate the data flow caused by
swap as much as possible. For instance, if you had an opportunity to
dedicate two disk drives to swap, it would be better to put them on
separate controllers than on the same controller.
I probably should point out that if you still are hunting for more
server power (in the aggregate sense), use solid state drives for swap.
Again, there is no point in doing this if you have not already maxxed
out the amount of physical RAM in the machine you're working on.
The *size* of a swap partition is not all that meaningful. It does
represent a "hard wall" in your total virtual memory size that you
cannot get past, but a 512MB RAM box with 2GB of swap space does *not*
constitute a significant improvement over the same box with 4GB of swap
space. Believe me, by the time nearly 2GB of swap space is actively in
use, the machine is going to be so far into the weeds it'll be almost
useless.
The way I like to think of a loaded-up VM OS such as Linux is as a
graph, expressed roughly as performance as a function of load. The
graph line will run from some maximum at nearly zero load and slope
downward fairly gently until physical RAM is nearly used up; at this
point the graph line will "knee" downward and at higher load amounts
than that, the line straightens out again but a significantly steeper
slope. This continues until the line falls to the bottom of the graph;
at this point the machine simply can't get out of its own way.
The two things you want to have some control over are how gentle or
sharp the "knee" is and how steep the line decays under higher loads.
What you'd like to do is keep the machine running at a load level just
below the knee but perhaps tipping into it or a little beyond in peak
load situations.
Back in my VMS days, when system load ramped up, there would actually be
a pronounced slowdown for a while because the OS was frantically trying
to sort itself out as it began using swap.
In your situation, though, I wonder what difference it might make to use
one of the newer kernels with the preemptible-kernel path folded in;
that may improve the situation with your NIC.
- Jeff
On Mon, 2003-02-17 at 17:28, ChangingLINKS.com wrote:
> Exactly. I do have a machine only for the LINKER process. (and a little NFS).
>
> Drew
>
> On Monday 17 February 2003 4:13 pm, Geoffrey wrote:
> > What you need is a totally separate machine for your LINKER process.
> >
> > ChangingLINKS.com wrote:
> > > That is a great idea! My server gets crushed by a program that I call
> LINKER.
> > > LINKER makes multi-threaded connections to the Internet and collects data.
> Of
> > > course, while it is collecting the data, some of the web sites that it
> > > collects data have connection errors.
> > >
> > > I had two programmers look at the software, and it seems to bottleneck at
> the
> > > nic card. I can open another session and run as many as 2 more instances
> of
> > > the program - but usually the server gets sluggish (insofar as gettting
> > > results) at 2 instances.
> > >
> > > While that is going on, I can open 2 more instances on two more servers,
> and
> > > all of them seem to run at full speed - so it doesn't seem to be a data
> > > transfer problem.
> > >
> > > This is why I was adding 2 nics to the server. This is also why I think it
> may
> > > be a good idea to double my swap?
> > >
> > > How do I run a test to see whether more swap is needed?
> > >
> > > I have 512RAM, and 1019 swap(I think).
> > >
> > >
> > > Drew
> > >
> > >
> > >
> > > On Monday 17 February 2003 1:38 pm, Michael D. Hirsch wrote:
> > >
> > >>On Monday 17 February 2003 02:30 pm, Chris Ricker wrote:
> > >>
> > >>>On Mon, 17 Feb 2003, James P. Kinney III wrote:
> > >>>
> > >>>>With a 2.4.x kernel and RAM <=4G swap=2xRAM
> > >>>
> > >>>That's not necessary. There was a bug in early 2.4.x that required
> > >>>swap=2xRAM for decent performance, but that's long since been fixed...
> > >>>
> > >>>You need enough swap to hold your working set. That could be anything
> > >>>from no swap to gigabytes, depending on what you do on that system....
> > >>
> > >>Right, but the rational I heard is
> > >>
> > >>1. Having swap doesn't hurt
> > >>2. Unless you have so many processes and so much swap space that you get
> > >>swap bound
> > >>3. swap = 2 x RAM is a reasonable heuristic. If you use much more than
> > >>that you are probably swap bound, but up to that amount could really
> > >>happen without getting swap bound.
> > >>
> > >>Obviously one can create loads that would be usable with more than that
> > >>much swap in use. One could also create loads that are unusable with less
> > >>than that much in use. It is just a rough guess that often works okay,
> > >>and few of us have the time or ability to really do an analysis of our
> > >>swap needs.
> > >>
> > >>Michael
> > >>_______________________________________________
> > >>Ale mailing list
> > >>Ale at ale.org
> > >>http://www.ale.org/mailman/listinfo/ale
> > >>
> > >>
> > >
> > >
> >
> > --
> > Until later: Geoffrey esoteric at 3times25.net
> >
> > The latest, most widespread virus? Microsoft end user agreement.
> > Think about it...
> >
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org
> > http://www.ale.org/mailman/listinfo/ale
> >
> >
>
> --
> Wishing you Happiness, Joy and Laughter,
> Drew Brown
> http://www.ChangingLINKS.com
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list