Reputation: 9036
I'm benchmarking Node.js with ApacheBench under Mac OS X and I'm comparing it with Apache 2. I basically have three questions:
My basic test of a Hello World web page resulted in the following: https://i.sstatic.net/sQNDL.png Node.js serves "Hello World" as plain text through a web server and Apache 2 serves a plain text file which also only contains "Hello World". I did the same test with 8000 requests and it shows the same increase of response time during the last 1000 requests. What is the reason for the increase in the end?
Is there an equivalent for linux dstat on Mac OS X to record the memory and CPU usage during the test?
Is there a base set of tests that have to be performed to get an evaluation of the performance, throughput etc. of a web server?
Upvotes: 1
Views: 1041
Reputation: 1765
There comes a point when your tests query the server faster than it can respond, this causes unresolved requests to accumulate at an increasing rate. Their overhead disproportionately impact response times. In other words, you performed a DDoS attack on your server and discovered it's capacity.
There is the unix 'top' command, but it's a bit fiddly, there is also ps
Quick google says that standards do exists for benchmarking webservers, such as SpecWeb, WebStone and SURGE
Upvotes: 1
Reputation: 10413
What do you mean by Apache? Apahce Tomcat? Apache 2? Apache Hadoop (okay not that one obviously)? You should specify what is the code you are benchmarking, and what is the platform. Depending on what you have write, you may be causing a lot of problems, in basic Hello World tests, NodeJS should perform better because executing a PHP script requires disk acccess, while most NodeJS Hello World tests are in-memory, because you just write response.send("Hello World");
which is way different than PHP benchmarks.
The reason for increase at the end is limits of your computer. Your computer cannot maintain many hundreds of open connections. NodeJS responds all connections one by one, while the Apache is firing up new threads, which will cause all of them to drain at the end, because there will be many context-swap so a slowness will occur at the end.
Upvotes: 1