PHP Swoole and Nodejs performance Analysis _php Tutorials

Source: Internet
Author: User
JS out of a nodejs, our technology boss before a time sent a technical message that PHP support multi-threading, asynchronous, non-blocking also in the banner said to extinguish Nodejs, the official website said Swoole performance has been at least and Nodejs can rival, this need to speak with data, At the weekend when you are free to test the two things! Here's the test report, huh.

First I tested the swoole with the 127.0.0.1:8000 port and tested it with 127.0.0.1:1337 Nodejs

There is a picture of the truth: (later, will not be saved with the Mac!) Sweat! All of you, who will teach me ah! Programming has become silly.)

Test environment:

Processor: 2.7GHz i7

Memory: 16GB 1600hz DDR3

System MAC OS X

Put the test results first:

Test results for 1.PHPswoole:

~mysql|? Ab-n 5000-c Http://127.0.0.1:8000/This is apachebench, Version 2.3 < $Revision: 655654 $>copyright 1996 Adam Tw ISS, Zeus technology LTD, http://www.zeustech.net/Licensed to the Apache software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (Be patient) completed requestscompleted + requestscompleted requestscompleted req uestscompleted 2500 requestscompleted requestscompleted 3500 requestscompleted 4000 requestsCompleted 4500             requestscompleted requestsfinished requestsserver software:server hostname:127.0.0.1server Port:   8000Document Path:/document length:0 bytesconcurrency Level:100time taken for tests: 1.411 secondscomplete requests:5000failed requests:0write errors:0total transferred:55330 byteshtml transferred:0 bytesrequests per second:3543.00 [#/sec] (mean) time per request:28.225 [MS] (MEA N) Time per request:0.282[MS] (mean, across all concurrent requests) Transfer rate:38.29 [Kbytes/sec] receivedconnection times (ms) min MEAN[+/-SD] Median maxconnect : 0 3 1.2 3 7processing:17 16.7 143waiting:1 9 12.9 7 136     Total:20 16.6 143Percentage of the requests served within a certain time (MS) 50% 26 66% 75% 80% 90% 95% 98% 141 99% 142 100% 143 (Longest request)

Test results for 2.nodejs:

~mysql|? Ab-n 5000-c Http://127.0.0.1:1337/This is apachebench, Version 2.3 < $Revision: 655654 $>copyright 1996 Adam Tw ISS, Zeus technology LTD, http://www.zeustech.net/Licensed to the Apache software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (Be patient) completed requestscompleted + requestscompleted requestscompleted req uestscompleted 2500 requestscompleted requestscompleted 3500 requestscompleted 4000 requestsCompleted 4500             requestscompleted requestsfinished requestsserver software:server hostname:127.0.0.1server Port:   1337Document Path:/document length:12 bytesconcurrency Level:100time taken for tests: 1.215 secondscomplete requests:5000failed requests:0write errors:0total transferred:56500 0 byteshtml transferred:60000 bytesrequests per second:4116.49 [#/sec] (mean) time per request:24.293 [ms       ] (mean) time per request:0.243 [MS] (mean, across all concurrent requests) Transfer rate:454.26 [Kbytes/sec] receivedconnection times (ms)     Min MEAN[+/-SD] Median maxconnect:0 0 0.6 0 5processing:2 24 21.0 21 175waiting:2 20.8 174total:6 20.9 175Percentage of the requests SE    RVed within a certain time (MS) 50% 21 66% 22 75% 23 80% 24 90% 26 95% 32 98% 159 99% 100% 175 (Longest request)

In the AB test above, 100 concurrent requests per second were requested 5,000 times for a common interface.

PHP and Nodejs scores are good, the key is Swoole environment I used the--debug cause a lot of commands will be output, temporarily will not change back, (later in the company test environment re-test)

Time taken for tests:1.411 seconds

Requests per second:3543.00 [#/sec] (mean)

NodeJS

Time taken for tests:1.215 seconds

Requests per second:4116.49 [#/sec] (mean)

From the test results, although the Swoole test data slightly less, but this does not affect my view of swoole (and the configuration may not be very good), I feel for a C language written PHP, this is more than our current environment is much better.


http://www.bkjia.com/PHPjc/742409.html www.bkjia.com true http://www.bkjia.com/PHPjc/742409.html techarticle js out of a nodejs, our technology boss before a period of time sent a technical message that PHP support multi-threading, asynchronous, non-blocking also in the banner said to extinguish Nodejs, the official website said Swoole performance ...

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.