Simulating high traffic

Overview

If you find your VPS memory usage spikes at certain times of the day, you can use a benchmarking tool to simulate the high-traffic environment. Once running, you can then check memory processes to determine the cause of the problem.

This article explains how to use the ab command line benchmarking tool on your VPS.

To run the commands in this article, you must have a Shell user configured in your panel and general knowledge of the UNIX Shell. View the following articles for further information:

Benchmark tool

View the following link for further details on the ab command.

To use this tool:

  1. Log into your server via SSH.
  2. Run the following command:
    [server]$ ab -n 1000 -c 20 https://www.example.com/index.html

This command creates 1000 connections to https://www.example.com/index.html, limiting itself to 20 concurrent connections.

Viewing your processes while testing

While the ab command is running, open 2 more tabs in your terminal to observe server processes.

  • In the first window, run top -c. Then, sort by memory (Shift + M).
  • In the second window, run free -m (or watch free -m).

These commands are effective at profiling your sites and checking to see if caching is working. You can repeat this process for each of your domains to see which ones most affect your memory usage so you know where to optimize.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?