Slow Server? This is the Flow Chart You’re Looking For–reference

Your high-powered server is suddenly running dog slow,and you need to remember the troubleshooting steps again. Bookmark this page for a ready reminder the next time you need to diagnose a slow server.

Get on "top" of it

Linux's provides a wealth of troubleshooting information,but you have to know what you're looking for. Reference this diagram as you go through the steps below:

Step 1: Check I/O wait and CPU Idletime

How: use top - look for "wa" (I/O wait) and "id" (CPU idletime)

Why: checking I/O wait is the best initial step to narrow down the root cause of server slowness. If I/O wait is low,you can rule out disk access in your diagnosis.

I/O Wait represents the amount of time the CPU waiting for disk or network I/O.Waiting is the key here - if your CPU is waiting,it's not doing useful work. It's like a chef who can't serve a meal until he gets a delivery of ingredients. Anything above 10% I/O wait should be considered high.

On the other hand,CPU idle time is a metric you WANT to be high -- the higher this is,the more bandwidth your server has to handle whatever else you throw at it. If your idle time is consistently above 25%,consider it "high enough"

Step 2: IO Wait is low and idle time is low: check CPU user time

How: use top again -- look for the %us column (first column),then look for a process or processes that is doing the damage.

Why: at this point you expect the usertime percentage to be high -- there's most likely a program or service you've configured on you server that's hogging CPU. Checking the % user time just confirms this. When you see that the % usertime is high,it's time to see what executable is monopolizing the CPU

Once you've confirmed that the % usertime is high,check the process list (also provided by top). Be default,top sorts the process list by %CPU,so you can just look at the top process or processes.

If there's a single process hogging the CPU in a way that seems abnormal,it's an anomalous situation that a service restart can fix. If there are are multiple processes taking up CPU resources,or it there's one process that takes lots of resources while otherwise functioning normally,than your setup may just be underpowered. You'll need to upgrade your server (add more cores),or split services out onto other boxes. In either case,you have a resolution:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>