meadowlark-it-logo 1

Simple webserver diagnostics

If you host a webserver, a very important that its running optimally and is in proper conditioning.

Here is a small guide to various easy diagnostic tests you can check to see if you webserver is running up to grade.


Getting the tools setup:

Depending on your OS distribution running your webserver the installation methods may vary, However all the tools are all usually the same.

All of them can be invoked from the command line terminal or SSH shell, given that your webserver may be running on a remote system.

The tools include:

  • ping
  • htop
  • uptime
  • nload

Ping:

ping is a simple utility to see if your system is able to respond to systems on the network and check latency.

This comes pre-installed on almost every operating system.

A simple command to check if you are able to communicate with google DNS servers for example:

ping 8.8.8.8
ping checking latency between pc and google's DNS server

Htop:

Htop is a simple system utility to see system runtime stats like CPU usage, RAM usage, processes, etc. kind of like a task manager.

Install it on:

Ubuntu, and Debian derivatives:

sudo apt install htop

Fedora, OpenSUSE, and other RedHat derivatives:

sudo dnf install htop

Manjaro, and other Arch derivatives:

sudo pacman -S htop

Run it with:

htop
HTOP system task view

Uptime:

uptime is a simple utility to see how long you system has been up and running for.

This comes pre-installed on almost every operating system.

Run it with:

uptime
system has been up for about 5 minutes, on average the system hasn't been under any load.

Nload:

nload is a utility to see how much network traffic passes through your system in terms of uploaded and downloaded bytes.

Install it on:

Ubuntu, and Debian derivatives:

sudo apt install nload

Fedora, OpenSUSE, and other RedHat derivatives:

sudo dnf install nload

Manjaro, and other Arch derivatives:

sudo pacman -S nload

Run it with:

nload

(P.S pressing tab switches between network devices like ethernet and wifi to see how much traffic passed through each one)

nload viewing throughput of upload and download data.

Other Utilities:

If you are looking for a more overall system view, you might want to consider using glances.

Install it on:

Ubuntu, and Debian derivatives:

sudo apt install glances

Fedora, OpenSUSE, and other RedHat derivatives:

sudo dnf install glances

Manjaro, and other Arch derivatives:

sudo pacman -S glances

Run it with:

glances
Overall system view with glances.

What to concur from these diagnostic tests ?

Knowing these various parameters is all well and good, But one must know how to make use of them to analyze and troubleshoot issues with their webserver.

For example:

  • If your webserver takes very long to respond after clicking, it could be due to high latency (Use ping to check this, the greater the ping ms, the greater the latency)
  • If it does respond but loads up very slowly, it could be due to a bottleneck in the system network. (Use nload to see how much data is being uploaded at that time, try optimizing your website)
  • Other things that might be slowing down your website response handling is perhaps system load. (Use htop or glances to see the system load. If it is almost 100%, You might want to close unwanted services running in the background or upgrade your webserver to handle more users)
  • If your website has been down for a while (Use uptime to see and estimate when your server might have crashed, maybe due to a technical error or overloading)
  • Finally, if your server is unable to save user data to the internal database (Use glances to see disk usage, and clean up cache files or add more storage appropriately)

Wrap-up:

There are a lot of simple diagnostic tools for checking the server status. If you are looking for a graphical dashboard, consider using the cockpit-project.

crossmenu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram