Overview
You can use the ab benchmarking tool to simulate high traffic on your Managed VPS or Dedicated Server, then check your server's memory processes to determine what is driving usage spikes.
Prerequisites
To run the commands in this article, you must have a Shell user configured in your panel and general knowledge of the UNIX Shell.
What does a benchmarking tool do?
If you find your server's memory usage spikes at certain times of the day, you can use a benchmarking tool to simulate a high-traffic environment. Once running, you can then check memory processes to determine the cause of the problem.
How do I use the Apache HTTP server benchmarking tool?
To use the ab command tool, log in to your server via SSH and 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.
How do I view my processes while testing?
While the ab command is running, open two more tabs in your terminal to observe server processes:
- In the first tab, run top -c. Then, sort by memory (Shift + M).
- In the second tab, 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 are most affecting your memory usage so you know where to optimize.