relesbao / php-service-skeleton

A PHP skeleton for a service oriented architecture
MIT License
0 stars 0 forks source link

Improve the environment perfomance #3

Open relesbao opened 7 years ago

relesbao commented 7 years ago

After many tests using httperf i got some results with the default configuration:

httperf --server=localhost --uri=/ping --port=8080 --num-conns=2000 --rate=250

Total: connections 2000 requests 2000 replies 2000 test-duration 8.299 s Reply rate [replies/s]: min 238.2 avg 238.2 max 238.2 stddev 0.0 (1 samples)

If i increase the connection or rate then i start to lose connections.

After some tunning on the nginx i got the following results:

httperf --server=localhost --uri=/ping --port=8080 --num-conns=3000 --rate=300

Total: connections 3000 requests 3000 replies 3000 test-duration 19.210 s Reply rate [replies/s]: min 149.6 avg 197.1 max 222.4 stddev 41.1 (3 samples)

If you notice, i increased the max connections and rate, but lost some perfomance.

Changing from php7 to hhvm and from alpine to ubuntu16.04 i got the following results:

httperf --server=localhost --uri=/ping --port=8080 --num-conns=8000 --rate=750

Total: connections 8000 requests 8000 replies 8000 test-duration 11.429 s Reply rate [replies/s]: min 694.6 avg 695.0 max 695.3 stddev 0.5 (2 samples)

HHVM + Nginx + Ubuntu16.04 seem to perform better.

relesbao commented 7 years ago

I am suspicious that maybe i did something wrong on the nginx configuration because i found some benchmarks related to php7 vs hhvm and they should have similar perfomances.

Maybe ubuntu perform better than alpine for this configuration.

I will keep testing and posting results here.

relesbao commented 7 years ago

Found another way to benchmark HTTP requests, worth a try: https://github.com/wg/wrk