...
> I would strongly advise you to make your own measurements and heed
> your own counsel. I can only speak from my own experience, and I may
> well be speaking a whole load of codswallop. Or I may be right and the
> opposing view is wrong. Who's to tell?
>
> My own experience with backing swap has been almost uniformly bad,
> especially on machines running Apache and MySQL due to the massive
> performance hit it invariably causes. I see memory as a finite
> resource - you only have so much of it, so use it wisely and stay away
> from using all of it up.
>
> The oom killer is also a point of contention. The algorithm is
> designed to try and detect the best pid to kill in order to keep the
> machine up, but there is no measurement for "least important process".
> So instead it has to infer it from time last used, time running and
> various other bits. These assumptions can never be 100% right.
>
> I believe the best solution to running out of memory is well-written
> apps that degrade or die gracefully when they hit out of memory
> conditions. I always thought Apache was rather good at this, it would
> simply kill of the child process and deliver an error. You seem to
> have found a way round this :-)

I'd like to know more about that if anyone has info on it.  apache2 is
supposed to detect when the system runs out of memory and proceed to
kill child processes?  It failed to do so on my system which then
proceeded to lock up.

> kashani's advice seems reasonable, tune your machine to suit it's
> load. We've established that the problem was a client hitting your
> webserver 300 times in a minute. That is a DOS, so the solution would
> be to find a way to configure Apache to detect abuse like this and not
> deliver the page.

So any apache system that hasn't been configured with a special
security module can be locked up by refreshing a page a suitable
number of times within a suitable amount of time?

> But back to swap. I have two cases where it is rather useful. This
> notebook uses swap for image storage when hibernating, and my Sybase
> database servers at work use swap well, retrieving data pages from
> swap is faster than searching through the database indexes for where
> they are, simply because the kernel alredy knows exactly where the
> swapped data is on disk. But this is a niche circumstance and in no
> way representative of a typical Linux machine's behaviour.

In situations like the above, would you prefer a swap file to a swap
partition?  It sounds better to me.

> Summary: Do your own tests, make your own conclusions and vigorously
> defend them.
>
> Sorry for the complete lack of a definitive answer, we are victims of
> TheRealWorldOutThere(tm)

I can handle that. :)

- Grant

Reply via email to