Performance is one of the primary concerns when it comes to making an app production-ready. Since a major section of this chapter is about making our app performant, it makes sense to know right at the beginning how to quantitatively measure the performance of our app.
We will use a command-line tool called
siege for benchmarking our app. While it is not going to be the most scientific and accurate method, benchmarking with
siege will give us a fair idea about how well our app is performing.
$ sudo apt-get install siege
To start benchmarking an app located at
http://localhost:3000/, we would benchmark it this way:
$ siege -b -c100 -t10S http://localhost:3000/
Basically, we are performing a tiny denial of service (DoS) attack on our server and seeing how well it fares.
The options used in the command are listed as follows: