To run the program:
Node T.js
To view the system CPU idle rate:
SAR 1
Stress test, concurrent 100, complete 100,000 requests:
ab-c100-n100000 Http://127.0.0.1:8082/t.js
Memory from 11MB to 61MB, System CPU idle rate of 65%, RPS reaches 6049.
tip: Click on the image to see the original.
//t.php
<title>PHP test</title>
To run the program:
Php-s 127.0.0.1:8081-t./
To view the system CPU idle rate:
SAR 1
Stress test, concurrent 100, complete 100,000 requests:
ab-c100-n100000 http://127.0.0.1:8081/t.php
Memory from 19.6MB to 20.0MB, System CPU idle rate of 57%, RPS achieves11405.
Conclusion: both node. js and PHP CLI server are single-process HTTP requests, with PHP almost twice times more than node. js on RPS, with memory occupied by PHP but only node. js 1/3. node. JS is commendable that the system CPU idle rate is about 8% higher than PHP. In addition, although the HTTP protocol is not supported by PHP-FPM, its performance in handling PHP requests is no worse than PHP CLI server, and PHP-FPM can open multiple worker processes and take full advantage of multicore.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service