What to do when a Linux server is "slow"
Hi all:
I am a network admin that's pretty new to Linux. I have a couple SLES10 boxes running and occasionally our programmers will complain that they are "slow." When someone complains that a server is running slowly but it doesn't seem like a network issue (i.e. ping times are fine, no one else is complaining of slow network response), what should I be looking for on a Linux server? For example, on a Windows workstation you might try cleaning out temporary internet files, looking for a hung process, etc. Is there equivalent troubleshooting I can do for a Linux server to see if something may be using abnormal amounts of processing power or memory, if there's a runaway or hung process, a directory full that could slow down the system, etc? I'm not looking for specific instructions, just general troubleshooting tips to gather information about why a server might be responding slowly. Thanks! |
Quote:
And since you're dealing with programmers, make sure you ask THEM questions, too. Are they compiling a big wad of code in one window, and are AMAZED that the system is under load in their other terminal? :) Database related stuff going on?? Could be beating the disk up, if you're on a development server, or if the database is on one disk, and the process is getting IO bound. Check out Nagios and other monitoring tools like that. Gives you handy graphs of CPU, memory, network performance, etc., and is a great thing to have if you're monitoring multiple servers. |
Excellent response. Thanks for the tips. I will check out some of those programs and commands right now. Strangely, one of the programmers sent me an email telling me I should check out Nagios for network monitoring...haha
Other replies still welcome! Thanks! |
Quote:
|
You probably won't need this, but thosewith less experience may find this http://aplawrence.com/Unixart/slow.html helpful.
|
Hi,
Quote:
|
Quote:
TB0ne has already outlined some tools for the 'find out what's wrong' phase. In addition, I like, or liked, ksysguard. It is not as detailed a tool as some as those that TB0ne mentions, but it can be configured to look at several different aspects of performance slowdowns. It is however a bit heavy in memory footprint and if not having enough memory is your problem or part of your problem, then that would be exactly what you don't want. (And the kde 4 version of ksysguard is a bit shaky, so far.) It does have the advantage that it can be used remotely, if you can figure out how to configure it to give you what you want. The particular things that you want to look for are (to start with)
One of the difficulties with the tools that TB0ne suggested is that it is easy to misinterpret the output (its a complex subject...it applies to an extent with any tool, but some of the output probably isn't at all obvious at first); I have to suggest that you need to read the man page more than once or a tutorial on the tool in question if you are not to make mistakes with them. One thing to watch out for is, if you see lots of disk activity, that doesn't mean that there is a disk problem. It may mean, eg, you don't have enough memory (or that you do have memory hogs) and that is causing excessive swapping. |
Quote:
I'm assuming that the tools tb0ne mentioned will help with that, but I haven't had a chance to look at the man pages for them. Also, I don't have a benchmark for what is "normal" so I wouldn't really know what to look for even if I did have the right tools. Don't get me wrong though. All of this is GREAT information and I appreciate it! I'll continue researching on my own too :) |
Quote:
Quote:
Quote:
|
All good advice above. 'Normal' is unique to each box, but, loosely speaking, if the load avgs >5 (consistently) its struggling a bit, avg >10 definitely a problem. If swap usage consistently > 25% of designated swap, you've got issues.
Note that Linux will run/walk with these loads or greater, but its not how you'd like to see it. |
Quote:
If, eg, you find that you don't have enough memory or that disk performance might be a bit on the low side, there might be an affordable solution to those problems and you might just not care beyond that. (And, sometimes, just spending money on the user's problem makes the user feel better, even if it doesn't improve performance.) If, however, you are pointed at a less affordable solution, you might be more inclined to be asking 'Why is the memory/disk under so much load? Why isn't the disk subsystem better performing' and following that path might be a bit more, errr, educational. Quote:
Have a look at top (or atop or htop if you prefer one of those) as its pretty good at pushing the big hitters towards the top of the display. Is it 'one big thing' or the 'aggregation of lots of little things'? Quote:
Quote:
I should also mention vmstat, if you have virtual memory problems (but don't believe the first line of its output...as is mentioned in the man page). |
Thanks for all the great advice guys. I thnk I've got all I need to go much further now. At the same time I'm actually building a linux from scratch system at home right now so that will help with understanding how everything works together.
|
Hi,
I must agree that you should be using the 'man command' to familiarize yourself. Just a few links to aid you; Linux Documentation Project Rute Tutorial & Exposition Linux Command Guide Utimate Linux Newbie Guide LinuxSelfHelp Getting Started with Linux Advanced Bash-Scripting Guide Virtualiation- Top 10 The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! :hattip: |
All times are GMT -5. The time now is 06:51 AM. |