The main idea of
Node.js : uses non-blocking, event-driven I/O to remain lightweight and efficient in the face of data-intensive real-time applications that run across distributed devices.
What it really means is that
Node.js is much faster for performing
I/O operation and it is capable of handling a huge number of simultaneous connections with high throughput, which equates to high scalability.
So in order to actually implement this and compare the performance with other web applications i did a
performance(benchmark) test of
node.js with
asp.net &
php.
Below are the configuration details:-
My(Client) System Configuration :
BandWidth: 512 kbps,
2.8Ghz Dual Core Processor,
4 GB RAM
Node.js & PHP Server Configuration :
BandWidth: 2 Mbps,
2.0Ghz Single Core Processor,
512 MB Ram
ASP.NET Server Configuration :
BandWidth: 2 Mbps,
2.8Ghz Quad Core Processor,
4 GB Ram
Tool used for performance testing :
Pylot [http://www.pylot.org/] , pylot is an open source web performance testing tool written in
python!
I created a
xml file with 5000 records following is the sample xml file :
<rows>
<number1>10</number1> <number2>20</number2>
</rows>
<rows>
<number1>884</number1><number2>775</number2>
</rows>
<rows>.........
</root>
Then i wrote three different programs in (PHP,Node.js & ASP.NET) to read the xml file and calculate sum of number1 & number2 in a loop and display the result.
Hosted Node.js ,PHP and ASP.NET on appropriate system and followed three test cases :
Test Case 1 :
Number of agent = 10
duration = 60 seconds
Test Case 2 :
Number of agent = 30
duration = 60 seconds
Test Case 3 :
Number of agent = 50
duration = 60 seconds
Result
ASP.NET
PHP
Node.js
As you can clearly see from the above result that Node served maximum number of requests with less response time.
Now a final war between Node.js & PHP with 80 agents :
Node.js Wins