|
Boost : |
Subject: [boost] [asio]https significantly reduce performance
From: lx (lxlenovostar_at_[hidden])
Date: 2019-01-30 01:48:13
Hi Boost experts:
I build a https server from asio example of server2, let it support
ssl.we use the codes from:
*https://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/example/http/server2/main.cpp
<https://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/example/http/server2/main.cpp>*
*https://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/ssl/server.cpp
<https://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/ssl/server.cpp>*
I complie the codes with boost_1_64 and openssl-1.1.0j, the commed
line of complie is:
*g++ -g -Wall -o https_server2 *.cpp -I/usr/local/include/
-I/usr/local/openssl-1.1.0j/include -L/usr/local/openssl-1.1.0j/lib
-I/usr/local/boost_1_64_0/include
/usr/local/boost_1_64_0/lib/libboost_thread.a
/usr/local/boost_1_64_0/lib/libboost_system.a -Wl,-Bstatic -lglog
-lunwind -Wl,-Bdynamic -lpthread -lcrypto -lssl -ldl -lrt*
I test the https_server2 by ngrinder, the TPS is just 400, If I test is
just http request , the TPS is 36000. So https significantly reduce
performance.
The perf top result is:
[image: 1.png]
The top result is:
[image: 2.png]
When I test it by http request, the top result is:
[image: 4.png]
I have push the codes on github.
https://github.com/lxlenovostar/Programming_language/tree/master/cpp/test/server2_https_github
I test 2, 4, 8, 24, 32 threads,but this can't improve the TPS.I test
the nginx with 32 worker process, The TPS is about 5000.
So maybe lock in asio ?
btw: cpu is 32 cores, and Intel(R) Xeon(R) CPU E5-2440 v2 @ 1.90GHz
memory is 66GB.
os is CentOS 6.5
kernel is 2.6.32
Thank you.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk