Re: Linux responsiveness under heavy load

From: Khimenko Victor (khim@sch57.msk.ru)
Date: Wed Mar 08 2000 - 15:29:10 EST


In <Pine.LNX.4.10.10003082055300.13796-100000@linuxserver.it-xchange.com> Nicolas MONNET (nico@monnet.to) wrote:

> I hope this is the appropriate place to ask this kind of question ... I
> could'nt really find any useful info otherwise (web search). Here I go:

> I use almost Linux mostly for all my computing needs -- both personal and
> corporate. I've been extremely pleased for over 4 years. However
> something bothers me.

> I've noticed that under heavy loads, and actually, not so heavy loads,
> Linux's responsiveness is effectively very poor.

> 2 cases I've encountered lately:

> 1 - My company has a MySQL-backed web server. We need to compute stats and
> generate somewhat long series of queries on a regular basis (every n
> minutes). The database fits entirely in the disk cache, AFAIK: the machine
> is equipped with 300MB and the whole database is ~ 45MB. Now, as more
> queries are concurrently issued (more than 1 at once), the responsiveness
> gets worse. It's mostly significant when spawning new processes -- I.e
> when logging in from telnet from instance, which takes a few seconds. The
> system isn't even swapping, I can verify it. The load average in that case
> is between 2 and 4. The system is a proliant 1600 with 1 PII-450.

> It's not like there's a bunch of runaway processe: at most, 5 processes
> are running.

> 2 - I was using a perl script to install the Unreal Tournament Bonus
> pack .umod (basically a compressed package). The said script is marked as
> not being optimised, and it used up to 230M of memory whereas I have 128M
> of physical ram. Of course, it swapped a lot, as I expected it. But ...
> the system was absolutely unusable during that time. Not just slow ...
> absolutely unusable. Plus top showed it as 80% idle most of the time.
> (The disk is connected using UDMA/33 on a BE6-2 MB, the system is a
> PIII-450).

> Now I *hear* (but is it true?) that *BSD handles this sort of case much
> more nicely. Is it true? Is there anything planned to make linux perform
> better in this area? Are there workarounds? Niceing the process doesn't
> seem to do any good. Is there, for example, a way to force a process not
> to consume more than a certain % of the CPU?

> Thanks in advance for your help.

You can not do much in such cases. This is outstanding Linux's problem, not
something simple and easily fixable. Linux kernel is not multithreaded and this
mean that when kernel doing work (say flushing MySQL data on disk) userlevel
process can not interrupt it. Work is going to improve situation (important
file operations in 2.3 do not require global filesystem lock anymore) but
system still fell REALLY sluggish here while heavy swapping even with latest
2.3 (or even without heavy swapping but will high LA while parrallel make
compiling kernel). Plus Linux is REALLY bad when it's out of memory and this
also is VERY slowly changing. You can limit PROCESS'S cpu but you can not
limit KERNEL'S cpu and in your second example your system was mostly waited
for disk to deliver data in kernel mode (as for first example: 2.3 should help
great deal here but do not install it on production server now :-)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:14 EST