{"id":291562,"date":"2018-10-30T06:45:02","date_gmt":"2018-10-30T03:45:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291562"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-10-30T03:45:02","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291562","title":{"rendered":"\u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 WSGI-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432: \u0432\u0435\u0440\u043d\u0435\u043c uWSGI \u043d\u0430 \u043c\u0435\u0441\u0442\u043e"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0431\u044b\u043b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u0432\u0443\u0445\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/habr.com\/post\/427217\/\">\u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 WSGI-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432: \u0427\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f<\/a>, \u0433\u0434\u0435 \u043d\u0435\u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043e \u0431\u044b\u043b \u043e\u0431\u0434\u0435\u043b\u0435\u043d \u0441\u043b\u0430\u0432\u043e\u0439 uWSGI.<br \/>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0440\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b!<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nq\/8d\/mj\/nq8dmje1vzgpvfevzxuz1xlitbw.png\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"celi\">\u0426\u0435\u043b\u0438<\/h1>\n<p>  <\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0435\u043b \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u0441\u0442\u044b, \u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441 uWSGI.<br \/>  \u0412 <a href=\"https:\/\/github.com\/omedhabib\/WSGI_Benchmarks\">\u043a\u043e\u0434\u0435<\/a> \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u2014 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0439 \u043a\u0432\u0435\u0441\u0442, \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445.<\/p>\n<p>  <\/p>\n<h1 id=\"shagi\">\u0428\u0430\u0433\u0438<\/h1>\n<p>  <\/p>\n<h2 id=\"wrk-410\">wrk 4.1.0<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/GetPageSpeed\/wrk-rpm\">\u0441\u043f\u0435\u043a\u0438<\/a>, <a href=\"https:\/\/github.com\/GetPageSpeed\/wrk-rpm\/pull\/2\">\u043f\u0440\u043e\u043f\u0430\u0442\u0447\u0438\u0442\u044c<\/a>, <a href=\"https:\/\/copr.fedorainfracloud.org\/coprs\/vorona\/wrk\/packages\/\">\u0441\u043e\u0431\u0440\u0430\u0442\u044c<\/a><br \/>  \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 readme.rd.<\/p>\n<p>  <\/p>\n<h2 id=\"docker-stats\">docker stats<\/h2>\n<p>  <\/p>\n<p>\u0417\u0430 2 \u0433\u043e\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438.<br \/>  \u0411\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430 <code>NAME<\/code>, \u0438 \u044d\u0442\u043e \u0441\u043b\u043e\u043c\u0430\u043b\u043e \u043f\u0430\u0440\u0441\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438.<br \/>  \u0427\u0442\u043e \u0431\u044b \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u0433\u043e\u0434\u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">- docker stats &gt; \"$BASE\/$1.$2.stats\" &amp; + docker stats --format \"{{.CPUPerc}} {{.MemUsage}}\" &gt; \"$BASE\/$1.$2.stats\" &amp;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u043f\u0430\u0440\u0441\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"debian\">debian<\/h2>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 <em>latest<\/em> \u043e\u0431\u0440\u0430\u0437 debian \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 <em>9.5<\/em>, \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u044d\u0442\u043e \u0432 Dokerfile:<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">- FROM debian + FROM debian:9.5<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0430\u043f\u0440\u0435\u043b\u0435 2016 <em>latest<\/em> <a href=\"https:\/\/web.archive.org\/web\/20160413073536\/https:\/\/hub.docker.com\/r\/library\/debian\/tags\/\">\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b<\/a> \u0432\u0435\u0440\u0441\u0438\u0438 8.4<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435\u0435, \u0410pache \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0442\u0435\u043c-\u0436\u0435: \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0435\u0440\u0441\u0438\u044f Apache 2.4.25, \u0430 \u0432 2016 \u044d\u0442\u043e \u0431\u044b\u043b Apache 2.4.10.<\/p>\n<p>  <\/p>\n<h2 id=\"cherrypy-tornado-uwsgi-gunicorn-bjoern-meinheld-mod_wsgi\">cherrypy tornado uwsgi gunicorn bjoern meinheld mod_wsgi<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u0436\u0435 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c.<br \/>  \u0423\u043a\u0430\u0436\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">- RUN pip install cherrypy tornado uwsgi gunicorn bjoern meinheld mod_wsgi + RUN pip install cherrypy==17.4.0 \\ +                 tornado==5.1.1 \\ +                 uwsgi==2.0.17.1 \\ +                 gunicorn==19.9.0 \\ +                 bjoern=2.2.3 \\ +                 meinheld==0.6.1 \\ +                 mod_wsgi==4.6.5<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u044b\u043b\u043e \u0431\u044b \u043d\u0435 \u043f\u043b\u043e\u0445\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u044d\u0442\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 requirements.txt, \u043d\u043e \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u043a.<\/p>\n<p>  <\/p>\n<h2 id=\"cherrypy---cherootwsgi\">cherrypy -&gt; cheroot.wsgi<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u043d\u043e \u0432\u044b\u0448\u0435, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f 17.4.0.<br \/>  \u0412 \u0430\u043f\u0440\u0435\u043b\u0435 2016 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0432\u0435\u0440\u0441\u0438\u044f v5.1.0.<br \/>  \u0410 \u0432 2017 \u0433\u043e\u0434\u0443, \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"http:\/\/docs.cherrypy.org\/en\/latest\/history.html#v9-0-0\">9.0<\/a> \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043e\u0442\u0440\u0430\u0437\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">- from cherrypy import wsgiserver - server = wsgiserver.CherryPyWSGIServer( + from cheroot.wsgi import Server as WSGIServer + server = WSGIServer(<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"socket-errors-read-100500\">Socket errors: read 100500<\/h1>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u043f\u0440\u0430\u0432\u043e\u043a \u0431\u044b\u043b \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442.<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u044b\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u0438: uwsgi \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043d\u0435 3&#8230;200, \u0430 7500&#8230;5000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.<br \/>  \u041d\u043e \u043f\u0440\u0438 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0442\u0432\u0435\u0442\u044b <em>wrk<\/em> \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u043b \u043a\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0438 \u0447\u0442\u0435\u043d\u0438\u044f.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u0435\u0441\u044f\u0442\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 uwsgi, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442 \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 http1.1: <em>&#8212;http-keepalive<\/em> \u0438 <em>&#8212;http11-socket<\/em>.<br \/>  \u041f\u0440\u0438\u0447\u0435\u043c, \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u0430\u0435\u0442 7500&#8230;5000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 29 \u0442\u044b\u0441\u044f\u0447!<\/p>\n<p>  <\/p>\n<h1 id=\"chto-zhe-izmenilos-v-uwsgi-na-dannyy-moment\">\u0447\u0442\u043e \u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 uWSGI \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442<\/h1>\n<p>  <\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432 \u0430\u0432\u0433\u0443\u0441\u0442\u0435 2016 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0432\u0435\u0440\u0441\u0438\u044f uWSGI 2.0.12 (20151230).<br \/>  \u041f\u043e\u0441\u043b\u0435, \u0432 \u043c\u0430\u0435, \u0432\u044b\u0448\u043b\u0430 <a href=\"https:\/\/uwsgi-docs.readthedocs.io\/en\/latest\/Changelog-2.0.13.html\">uWSGI 2.0.13<\/a>.<br \/>  \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0432\u0435\u0440\u0441\u0438\u0438 <em>wrk<\/em> \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u043b\u043e \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e 2018 \u0433\u043e\u0434\u0430, \u0432\u044b\u0445\u043e\u0434\u043e\u043c <a href=\"https:\/\/uwsgi-docs.readthedocs.io\/en\/latest\/Changelog-2.0.16.html\">uWSGI 2.0.16<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>Back-ported HTTP\/1.1 support (&#8212;http11-socket) from 2.1<\/p><\/blockquote>\n<p>\u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 uWSGI \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 NginX,<br \/>  \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/github.com\/wg\/wrk\/issues\/13\">\u0442\u0438\u043a\u0435\u0442\u0430<\/a> 2012 \u0433\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h1 id=\"pochemu-togda-byli-takie-rezultaty\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0442\u043e\u0433\u0434\u0430 \u0431\u044b\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h1>\n<p>  <\/p>\n<p>\u042f \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438: <\/p>\n<p>  <\/p>\n<ul>\n<li>2.0.12 \u0434\u043b\u044f debian 8.4, \u043d\u0430 \u0434\u0435\u0432\u044f\u0442\u043a\u0435 \u043e\u043d\u0430 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0441\u0432\u0435\u0436\u0435\u0439 openssl.<\/li>\n<li>2.0.13&#8230;2.0.17 \u0434\u043b\u044f debian 8.4 \u0438 9.5<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u043e \u0442\u0430\u043a\u0438\u0445 \u043f\u043b\u043e\u0445\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043a\u0430\u043a 3&#8230;200 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u043c\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c.<br \/>  \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<blockquote><p>uwsgi &#8212;http :9808 &#8212;plugin python2 &#8212;wsgi-file app.py &#8212;processes &#8230;<\/p><\/blockquote>\n<p>\u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 uwsgi \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0430 \u043d\u0435 pip.<br \/>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u0431 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0443 \u0430\u0432\u0442\u043e\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u0442\u0435\u043a\u043e\u043c.<br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0442\u0435\u0441\u0442 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 uwsgi-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0432 \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/li>\n<li>\u0438\u043c\u0435\u043b \u043c\u0435\u0441\u0442\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 uwsgi, \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 pip.<\/li>\n<li>\u0432\u0435\u0440\u0441\u0438\u044f wrk \u0430\u0432\u0442\u043e\u0440\u0430 \u0432 2016, \u0438\u043c\u0435\u043b\u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e http1.0<\/li>\n<li>uwsgi \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/li>\n<li>\u0437\u0430\u043a\u0430\u0437\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u0446\u0438\u0444\u0440\u044b \u0441 \u043f\u043e\u0442\u043e\u043b\u043a\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"kakie-rezultaty-seychas\">\u041a\u0430\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u0435\u0439\u0447\u0430\u0441<\/h1>\n<p>  <\/p>\n<p>uWSGI \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e:<br \/>  \u041f\u0435\u0440\u0432\u044b\u0439 <em>uWSGI<\/em> (v2.0.17.1), \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0432 \u0434\u043e\u043b\u0433\u043e\u043c \u0442\u0435\u0441\u0442\u0435, \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u0430\u043c\u0438, \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 <code>--http11 :9808 --processes 5 --threads 2 --enable-threads<\/code>.<br \/>  \u041f\u043e\u0442\u043e\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b:<br \/>  <em>uWSGIbase<\/em> (v2.0.17.1), \u0431\u0435\u0437 threads: <code>--http11 :9808 --processes 5<\/code>.<br \/>  uWSGI-v2.0.12th-old \u0438 uWSGI-v2.0.12nt-old \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e v2.0.12 \u0441 \u0442\u0440\u0435\u0434\u0430\u043c\u0438 \u0438 \u0431\u0435\u0437 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 debian 8.4.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sf\/bd\/vf\/sfbdvf04fhkyuzv4ejjvl4bcz1q.png\" alt=\"RPS 2018 ALL\"><br \/>  uWSGI \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 2\u0435 \u043c\u0435\u0441\u0442\u043e, \u043d\u0435 \u0441\u043d\u0438\u0436\u0430\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/k4\/ob\/bd\/k4obbdqgbjrezvofvuoolhbhlcc.png\" alt=\"RPS 2018 LOW\"><br \/>  \u0412 low-\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 uWSGI-v2.0.12 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0445, \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yb\/ec\/y5\/ybecy5pt_2btdvmsarjncel37aq.png\" alt=\"LATENCIES 2018 ALL\"><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/d1\/bm\/tm\/d1bmtm1j-ylect7-dwpkb3hkftk.png\" alt=\"LATENCIES 2018 LOW\"><br \/>  uWSGI \u0438 CherryPy \u043d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u0438 \u043f\u043e latency.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4g\/b3\/dv\/4gb3dvuktcc9ulm4acyfipo51yq.png\"><br \/>  \u042d\u0442\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 2016-\u043c\u0443 \u0433\u043e\u0434\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kf\/-m\/tn\/kf-mtnnovvgsvflm5cofob6cakm.png\"><br \/>  \u0422\u0443\u0442 \u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a \u0441\u0442\u0430\u0440\u044b\u0435 uWSGI \u043a\u0443\u0448\u0430\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uc\/tn\/id\/uctnidaagbogmc9ok1uqz5epwky.png\"><br \/>  \u0410 \u043d\u043e\u0432\u044b\u0439 uWSGI &#171;\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043b\u0430\u043d\u043a\u0443&#187;, \u0438 \u044d\u0442\u043e \u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/z1\/-u\/fz\/z1-ufzptcbx75flkh0qs9il_njk.png\"><br \/>  C\u0442\u0430\u0440\u044b\u0435 uWSGI \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0435\u0437\u043a\u043e \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 300 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2e\/4z\/_d\/2e4z_ds3gped0gapnw6dwskyv-i.png\"><br \/>  Bjoern \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0434\u0430\u0432\u0430\u0442\u044c \u0441 1000 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.<br \/>  \u0410 \u0432\u043e\u0442 \u0441 \u043d\u043e\u0432\u044b\u043c uWSGI \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f 200 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 50 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438 \u0447\u0438\u0441\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u042d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u044b <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/e\/2PACX-1vSTmHtegrA2mKYb-yam00ii_cTq7rvVqLk0cSXVoovQCboTOBJYdQMnTx4KshyMsmuj4qrirbskMTav\/pubhtml\">\u0442\u0443\u0442<\/a><\/p>\n<p>  <\/p>\n<h1 id=\"vyvody\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h1>\n<p>  <\/p>\n<p>uWSGI \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u043f\u043b\u043e\u0445.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432 WRK, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u043e\u0437\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!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\/javascript\",r.async=!0,r.defer=!0,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\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/428047\/\"> https:\/\/habr.com\/post\/428047\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0431\u044b\u043b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u0432\u0443\u0445\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/habr.com\/post\/427217\/\">\u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 WSGI-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432: \u0427\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f<\/a>, \u0433\u0434\u0435 \u043d\u0435\u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043e \u0431\u044b\u043b \u043e\u0431\u0434\u0435\u043b\u0435\u043d \u0441\u043b\u0430\u0432\u043e\u0439 uWSGI.<br \/>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0440\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b!<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nq\/8d\/mj\/nq8dmje1vzgpvfevzxuz1xlitbw.png\"><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-291562","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291562"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291562\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}