Accelerating a server

Accelerating a server

Nadav Har'El nyh at math.technion.ac.il
Tue Jun 28 18:39:22 IDT 2011


On Tue, Jun 28, 2011, Steve G. wrote about "Accelerating a server":
> I have a server that is sometimes sluggish. While I suspect the main problem
> is DNS and routing issues with my provider's infrastructure, in particular
> responding to DNS requests and routing, I am not sure. So here are some
> questions to the server experts on the team:
> 
> 1. How do I identify the bottleneck in server performance? Is the problem
> with my networking card, CPU, memory, HD I/O, or the networking
> infrastructure outside the home.

This is a *very* broad question. If you're not even sure if have DNS problems
or your CPU is staturated, you have to start from the beginning - there's no
single silver bullet which will solve all your problems.

Obviously, to see if your CPU is the bottleneck, start with running "top",
see what is running and how much of the time is spent idle (the "%id" field).
If you see that much of the time is idle, then your CPU is NOT busy, and you
can forget about this angle.

If your bottleneck is a shortage in memory, it is likely you'll see a lot
of swapping activity - run something like "vmstat 10" and see there is a lot
of swapping activity. If there is, you need to reduce your memory usage, or
buy more memory.

To see how much disk activity there is, try running "iostat 10".

To see if your DNS is completely broken, try something like
"dig www.google.com". You'll see if the name server responds, and how
quickly. Examine /etc/resolv.conf if you suspect problems in this area.

And, of course, it can be one of a hundred other things.

> 2. Is there a tool for monitoring or testing load and performance without
> disabling or slowing down the server for long periods of time? I use

I think you are getting confused - how can you monitor your system's load
while disabling it? :-) All tools which I mentioned above, and similar tools,
just measure the running system, and have a negligable impact on performance,
and you can keep your system running.


> 3. If I had to do one thing to improve my hardware, which should it be?
> RAID? SD drive? Faster CPU? 32 to 64 bus? More/Faster memory? Obviously cost
> is a consideration.

This is a meaningless question if you don't know what the problem is.
If your DNS is misconfigured, for example, none of these purchases are
relevant.

> 4. Is there any general advice on improving performance by removing
> background programs, etc.?

Knuth is quoted as saying "Premature optimization is the root of all evil".
If you do "ps aux" you'll find dozens or even hundreds of processes seemingly
conspiring to eat up your resources. Most of them don't! Most of them hardly
use up any memory, hardly use any CPU, and will not cause any problem
whatsoever, and killing them will cause you more problems then you will solve.

If you suspect there are processes hogging your computer, use "top" to
find the processes which use up the most CPU time, and processes that use
up the most *resident* memory, and manually inspect only those. If you
don't know how to do that, please read top's manual page.


-- 
Nadav Har'El                        |      Tuesday, Jun 28 2011, 27 Sivan 5771
nyh at math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |If you choke a Smurf, what color does it
http://nadav.harel.org.il           |turn?



More information about the Linux-il mailing list