Article

Checking UNIX Server Performance

Page: 1 2 3

Users and Accounts

One question Webmasters hosted on a virtual or semi-dedicated account might ask themselves is how many people are on the server besides them – as no one wants to be on an overloaded server. Another UNIX command comes to the rescue:

wc -l </etc/passwd

The command is an acronym for “word count”. The -l parameter tells the program to count lines, while the remainder of the line tells it what to count. In this case, the command tells the program to count the file with the list of all accounts on the system. Keep in mind that not only user accounts are counted -- all system accounts will be counted, too. By default, UNIX will have about 15 system accounts. In addition to that, your server system administrator most likely added more system users to accommodate for many features on your server. Typically, on a virtual hosting server you can expect to find around 40 users who are not hosting clients. If you ever want to view a full list of the users, there's a command which you can utilize.

more /etc/passwd

The more command will call the passwd file, which essentially contains a list of every account on the system. You can look at what other sites or users are on your server, count all the actual hosting accounts (based on their username), or complete a range of other queries. Also, if you ever want to know the list of everyone who is logged in to the machine at the time, you can run the “who” command.

Additional Utilities

One more useful utility available on some servers is System Account Report, or “SAR” for short. The command is composed like this:

sar parameter count timeinterval

Parameter is a dash followed by a letter, which tells SAR what to report on. Following this are commands of how many times to check, and how many seconds to wait between checks. Usually the results aren't hard to decipher, especially with the help of the man command; but some common result abbreviations are “TPS” and “BPS”. “TPS” stands for transfers per second, in kilobytes. “BPS” is an acronym for blocks per second; one block is half of a kilobyte, or 512 bytes.

Here are some useful parameters:

  • -b (I/O and transfer rate statistics)
  • -c (Process creation activity)
  • -d (Disk activity)

There are plenty of other ways to check up on performance, but this covers the most relevant ones. And don't forget to use the man command if ever you’re not sure about something. Have fun exploring!

Further Reading (Books)

  • "Modern Operating Systems" by Andrew S. Tanenbaum
  • "Essential System Administration" by A. Eleen Frisch
  • "TCP/IP Illustrated, Vol. 1" by Richard Stevens

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

Sponsored Links

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: