AB is a tool for benchmarking Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give an impression of how current Apache installation performs. More specifically it shows how many requests per second Apache installation is capable of serving.
1. Update package database
$ sudo apt-get update
2. Install apache2 utils package to get access to ApacheBench
$ sudo apt-get install apache2-utils
Here i got a generic error
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Here the lock file can be deleted. But that should be last measure; maybe if there is no alternative. Better to check what is running-
On checking that I got
$ ps aux | grep "[a]pt"
root 30961 0.4 0.7 297404 57160 ? SNl 18:42 0:01 /usr/bin/python3 /usr/sbin/aptd
I killed that specific process
$ sudo kill 30961
Now just retry to run
apt-get install again and should work fine.
$ man ab
Should respond with all the details.
I’ll come up with another post to explain how I’m using ab to benchmark API.
Note: ab documentation