Article

Home » Server-side Coding » Server Side Essentials » Checking UNIX Server Performance

About the Author

Oleg Krogius

author_olegk Oleg is an avid Webmaster, and a highly motivated PHP and MySQL programmer. He is also the founder of CGShock, an upcoming gaming and Webmaster-related site.

View all articles by Oleg Krogius...

Checking UNIX Server Performance

By Oleg Krogius

July 23rd, 2002

Reader Rating: 7.5

Page: 1 2 3 Next

Today, fast load times are crucial to the success of your Website. They improve the user experience, allowing your visitors to take full advantage of your site’s functionality, and ultimately help you gain more traffic. But how can you achieve these fast load times? Good server performance is the answer.

Many Webmasters today don't bother -- or know how -- to check a server’s performance. Virtual (or shared) Web hosts might check their servers’ performance now and then; however, if you're running on a dedicated server, you really need to check its performance on regular basis. If a potential problem isn't taken care of quickly, it could soon bog down the entire server.

Getting Started

There are many different protocols and other ways to connect to your server, and among the most popular command line variants are Telnet and SSH. Any information you transfer via Telnet is sent in plain text, so anyone running a Network packet sniffer could gain access to any sensitive details you might send.
In order to accommodate the need for security and privacy Secure Socket Shell (SSH) was developed, which is basically a secure version of Telnet that encrypts any information you enter prior to sending the data across the Web. As the SSH read me file technically phrases it,

"SSH (Secure Shell) is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over insecure channels. It is intended as a replacement for rlogin, rsh, and rcp."

For more info and help on SSH head to the SSH homepage.

In order to access your server, you’ll need a program capable of using SSH protocols. One of my preferred Windows programs is Putty, which has a nice, streamlined command prompt interface. Once you start Putty or another SSH program of your choice, you’ll need to connect to your Web server before you can run any commands. Some programs will provide a GUI (graphical user interface) through which you can enter your info, while others will provide a command line interface. If you're left with a plain command line, obviously you’ll need to enter a command in order to connect.

ssh hostname -l username

You’ll need to substitute the hostname with the domain name or IP address of the site you're connecting to. The -l parameter tells the program to not log you in as root, but under some other username. Submit the command and you’ll be prompted for your password. Note that unlike Windows, with which you’re probably familiar, you won't see any asterisks as you enter your password. After you’re authenticated, you’ll be logged in.

If you ever forget what username you’re logged in as, you can run this simple UNIX command:

whoami

Once you're logged in, you are exposed to the world of command line commands of your operating system. Explore all you wish, but try to find out what a command does before you run it. You can obtain a description of what any UNIX command does using the man command, followed by the command you're interested in learning about. For example:

man top

This will give you an explanation of the top command, which we’ll get into a bit later. Don't run any commands you aren't sure about -- it just takes one command to wipe your hard drive clean, so be careful!

Server Specifications

What your server can do is greatly affected by the hardware inside it. CPU(s) and RAM are the two main players. How do you know what your server’s capable of? Well, one of the most useful UNIX commands regarding performance is top. It displays the most important data about what’s going on in your server. Here's a typical example of what you might get as a part of top query result:

7:06pm up 81 days, 7:47, 1 user, load average: 2.90, 2.25, 2.14
214 processes: 209 sleeping, 5 running, 0 zombie, 0 stopped
CPU0 states: 66.3% user, 14.4% system, 27.1% nice, 18.4% idle
CPU1 states: 71.1% user, 14.4% system, 37.1% nice, 13.2% idle
Mem: 3867832K av, 3853780K used, 14052K free, 0K shrd, 100388K buff
Swap: 530104K av, 45980K used, 484124K free 3228192K cached

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links