Analysis of the performance of WSGI-servers: return uWSGI to the place
3r33333. Last week, a translation of a two-year-old article 3–3–35 was published. Analysis of the performance of WSGI-servers: Part Two 3r33333. where it was undeservedly deprived of the glory of uWSGI. 3r33333.
It is urgent to double-check the tests! 3r33333.
3r311. 3r33333. Code 3r33353. There are no versions of the packages and modules used. 3r33333.
Therefore, to run tests and get similar results - not work. 3r33333.
Next, my quest, to run the tests and compare the results on the charts. 3r33333. 3r33333.
3r3333. Steps
3r33333.
wrk ???
3r33333.
3r33333. Find
specs , patch , collect 3r33333.
Information added to readme.rd. 3r33333. 3r33333.
docker stats
3r33333.
3r33333. For 2 years, the output of statistics has changed. 3r33333.
A second column has been added. NAME
and it broke the statistics parser. 3r33333.
In order not to meet a similar problem in two years, we will use a formatted output: 3r33333. 3r33333.
3r33150. 3r3151. - docker stats> "$ BASE /$ 1. $ 2.stats" &
+ docker stats --format "{{.CPUPerc}} {{.MemUsage}}"> "$ BASE /$ 1. $ 2.stats" & 3r33333.
3r33333. And accordingly, let's slightly simplify the parser code. 3r33333. 3r33333.
debian
3r33333.3r33333. It is now latest The debian image is version ???r3r3280. , map this to the Dokerfile: 3r33333.
3r33150. 3r3151. - FROM debian
+ FROM debian: ???r3r3282. 3r33333.
3r33333. In April 201? latest 3r3-300. corresponded version ???r3r3364. 3r33333.
3r33333. Nevertheless, Apache remained almost the same: now the version of Apache ???? and in 2016 it was Apache ???. 3r33333. 3r33333.
cherrypy tornado uwsgi gunicorn bjoern meinheld mod_wsgi
3r33333.3r33333. It even makes no sense to say that the modules have changed. 3r33333.
We indicate the current version: 3r33333.
3r33150. 3r3151. - RUN pip install cherrypy tornado uwsgi gunicorn bjoern meinheld mod_wsgi
+ RUN pip install cherrypy == ???
+ tornado == ???
+ uwsgi == ???.1
+ gunicorn == ???
+ bjoern = ???
+ meinheld == ???
+ mod_wsgi == ??? 3r33333.
3r33333. It would not be bad to put it in separate requirements.txt, but for now let's leave it that way. 3r33333. 3r33333.
cherrypy -> cheroot.wsgi
3r33333.3r33333. As shown above, the current version is ???. 3r33333.
In April 201? version v??? was probably used. 3r33333.
And in 201? in version 3r3145. ???r33353. There were changes, which affected the server import: 3r33333.
3r33150. 3r3151. - from cherrypy import wsgiserver
- server = wsgiserver.CherryPyWSGIServer (
+ from cheroot.wsgi import Server as WSGIServer
+ server = WSGIServer (3r33232. 3r3156.
Socket errors: read 100500
3r33333.3r33333. After the edits described above, the first full test was launched. 3r33333.
The results were good: uwsgi did not issue 3 20? but 7500 5000 requests per second. 3r33333.
But when we looked at the graphs in detail, it turned out that all the answers were wrk detektil as read errors. 3r33333.
After checking a dozen keys to launch uwsgi, it turned out that there were no errors when http1.1: was turned on. --http-keepalive and --http11-socket . 3r33333.
Moreover, the first gives 7500 5000 requests per second, and the second stable 29 thousand! 3r33333. 3r33333.
3r3181. what has changed in uWSGI at the moment 3r33333.
3r33333. Most likely, in August 201? the version uWSGI ??? (20151230) was used. 3r33333.
After, in May, 3r3188 came out. uWSGI ??? . 3r33333.
It was a significant event, but a performance problem on version wrk it did not solve up to 201? exit uWSGI ??? : 3r33333.
Back-ported HTTP /1.1 support (--http11-socket) from ???r3r3235. 3r33333. That is why uWSGI recommended using with NginX,
And why it is important in the framework of the article, you can understand from this 3r3204. ticket 3r33353. 2012. 3r33333. 3r33333.Why then were these results 3r3r58b. 3r33333.
3r33333. I tried these versions: 3r33333.
??? for debian 8.? on the nine it is not collected because of the fresh openssl.
??? ??? for debian 8.4 and ???r3r3259.
3r33333.
3r33333. But I could not get such bad results as 3 200 requests per second. 3r33333.
Attention has drawn the application launch line: 3r33333.uwsgi --http: 9808 --plugin python2 --wsgi-file app.py --processes3r33333. Specifying a plug-in that says it installs uwsgi from the repository, not pip. 3r33333.
This may indicate the absence of the author's necessary experience with this stack. 3r33333.
Therefore, I admit several possibilities: 3r33333.
each of the uwsgi-servers was tested separately at different times.
there was some conflict between the uwsgi system version and the one installed via pip.
The author’s wrk version in 2016 had some features for working on http???r3r3259.
uwsgi started with a different set of parameters
custom article numbers from the ceiling.
3r33333.What are the results now
3r33333.
3r33333. uWSGI on the charts a few:
The first uWSGI (v???.1), performed in a long test, with its competitors, with the parameters 3r-3281. --http11: 9808 --processes 5 --threads 2 --enable-threads . 3r33333.
Then they were separately tested:
uWSGIbase (v???.1), without threads: 3r3323281. --http11: 9808 --processes 5 . 3r33333.
uWSGI-v???th-old and uWSGI-v???nt-old are respectively v??? with threads and without in a debian 8.4 container. 3r33333. 3r33333.
3r33333.3r33333.
uWSGI takes 2nd place, without reducing the results with increasing load. 3r33333. 3r33333.
3r33333.3r33333.
In the low-segment uWSGI-v??? best of all, even with increasing load. 3r33333. 3r33333.
3r33333. 3r3303. 3r33333. 3r33333.
3r33333. 3r3308. 3r33333.
uWSGI and CherryPy are undoubted latency winners. 3r33333. 3r33333.
3r33333. 3r33333. 3r33333.
This picture is similar to the 2016th year. 3r33333. 3r33333.
3r33333.3r33333.
Here we see how the old uWSGI ate the memory with increasing load. 3r33333. 3r33333.
3r33333.3r33333.
And the new uWSGI "keeps the bar", and that says a lot. 3r33333. 3r33333.
3r33333. 3r33336. 3r33333.
The old uWSGIs start picking up mistakes after 300 open connections. 3r33333. 3r33333.
3r33333. 3r33333. 3r33333.
Bjoern starts donating with 1000 connections. 3r33333.
But with the new uWSGI weirdness, starting 200 connections, we get 50 errors, and the number no longer increases. This moment requires detailed consideration. 3r33333. 3r33333.
3r33333. All data collected
here 3r33353. 3r33333. 3r33333.
3r33357. Conclusions 3r3r58. 3r33333.
3r33333. uWSGI is not so bad. 3r33333.
If you do not like the results of the WRK tests, try using other tools. 3r33333. 3r33333.
! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r33333.
3r33333.
It may be interesting
We take being #1 in Commercial Odor Remover Products & Systems very seriously. Here are some of the reasons you can trust Cupridyne Clean to bring you a solution to your Commercial Odor Control problem.