{"id":193082,"date":"2020-11-16T14:08:09","date_gmt":"2020-11-16T06:08:09","guid":{"rendered":"http:\/\/4563.org\/?p=193082"},"modified":"2020-11-16T14:08:09","modified_gmt":"2020-11-16T06:08:09","slug":"gunicorn-%e8%83%bd%e4%b8%8d%e8%83%bd%e5%9c%a8-pypy-%e4%b8%8a%e8%bf%90%e8%a1%8c%ef%bc%9f-pypy-%e6%9c%89%e5%8f%af%e8%83%bd%e9%83%a8%e7%bd%b2-web-%e6%9c%8d%e5%8a%a1%e5%90%97%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=193082","title":{"rendered":"Gunicorn \u80fd\u4e0d\u80fd\u5728 pypy \u4e0a\u8fd0\u884c\uff1f pypy \u6709\u53ef\u80fd\u90e8\u7f72 web \u670d\u52a1\u5417\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Gunicorn \u80fd\u4e0d\u80fd\u5728 pypy \u4e0a\u8fd0\u884c\uff1f pypy \u6709\u53ef\u80fd\u90e8\u7f72 web \u670d\u52a1\u5417\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : black11black <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5982\u9898\uff0c\u73b0\u5728\u6709\u4e00\u4e2a\u79d1\u5b66\u8ba1\u7b97\u7684\u540e\u53f0\u670d\u52a1\uff0c\u5176\u4e2d\u67d0\u4e00\u4e2a\u63a5\u53e3\u5355\u6b21\u8bf7\u6c42\uff0c\u901a\u4fe1\u65f6\u95f4\u4e3a 15 \u79d2\u5de6\u53f3\uff0c\u5355\u7eaf\u8ba1\u7b97\u90e8\u5206\u5927\u6982 4-5 \u79d2\u3002<\/p>\n<p>\u56e0\u4e3a\u670d\u52a1\u4e0d\u592a\u6ce8\u91cd\u7a33\u5b9a\u6027\uff0c\u5012\u662f\u60f3\u7565\u5fae\u63d0\u9ad8\u4e00\u4e0b\u53ef\u7528\u6027\uff0c\u4ee3\u7801\u662f\u7eaf python \u5b9e\u73b0\u7684\uff0c\u4e8e\u662f\u60f3\u5230\u7528 pypy \u52a0\u901f\u3002\uff08\u4e0d\u8003\u8651\u5d4c\u5165 jit \u4e4b\u7c7b\u7684\u9ed1\u9b54\u6cd5\uff0c\u6574\u4e2a\u9879\u76ee\u884c\u6570\u4e94\u4e07\u5de6\u53f3\uff0c\u5982\u679c\u8981\u5bf9\u6027\u80fd\u5bc6\u96c6\u533a\u57df\u5355\u72ec\u62ff\u51fa\u6765\u52a0\u901f\u7684\u8bdd\u9700\u8981\u4fee\u6539\u7684\u5730\u65b9\u592a\u591a\u4e86\uff09<\/p>\n<p>\u4e8e\u662f\u60f3\u5230\u90e8\u7f72\u7684\u95ee\u9898\uff0c\u6709\u6ca1\u6709\u5e26\u4f6c\u5728 pypy \u4e0a\u8dd1\u8fc7 gunicorn \u7684\uff0c\u56e0\u4e3a\u6211\u4e0d\u6e05\u695a gunicorn \u7684\u7f51\u5173\u600e\u4e48\u505a\u7684\uff0c\u5e73\u65f6\u4e5f\u53ea\u662f\u7528\u7740\u65b9\u4fbf\u800c\u5df2\u3002gunicorn \u662f\u5426\u6709 C \u8bed\u8a00\u5b9e\u73b0\u7684\u90e8\u5206\u4e0e pypy \u4e0d\u517c\u5bb9\u7684\u95ee\u9898\uff1f\u5982\u679c\u6709\u7684\u8bdd pypy \u5e94\u8be5\u5982\u4f55\u90e8\u7f72\u7f51\u7edc\u670d\u52a1\u5462\uff1f\uff08\u8fd8\u6709\u4e00\u79cd\u53ef\u80fd\u662f pypy \u5c31\u6ca1\u6cd5\u7528\u6765\u90e8\u7f72\u670d\u52a1\uff08\u60b2\uff09\uff09<\/p>\n<p>===============================<\/p>\n<p>web \u6846\u67b6 aiohttp<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4175928\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ebingtel <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             gunicorn \u7eaf py \u5b9e\u73b0\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4175929\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : black11black <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ebingtel <\/p>\n<p>\u6211\u521a\u624d\u770b\u6ca1\u4eba\u56de\u590d\u8bd5\u7740\u90e8\u7f72\u4e86\u4e00\u4e0b\uff0cgunicorn \u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u6709\u95ee\u9898\u554a\uff0c\u4ee5\u524d\u6ca1\u9047\u5230\u8fc7\u8fd9\u79cd\u60c5\u51b5\u3002<br \/>\u4e00\u822c\u7528 pypy \u90fd\u662f\u76f4\u63a5\u4ece\u5b98\u7f51\u4e0a\u4e0b\u4e2a\u4e8c\u8fdb\u5236 pypy3\uff0c\u89e3\u538b\u4ee5\u540e\u7528 pypy3 \u542f\u52a8\uff0c\u7528 pypy3 -m pip \u542f\u52a8\u5305\u7ba1\u7406\u5668\uff0c\u8fd9\u79cd\u60c5\u51b5\u662f\u6ca1\u6dfb\u52a0\u5230\u7cfb\u7edf\u8def\u5f84\u7684\u3002<\/p>\n<p>\u4f46\u662f pypy3 -m pip install gunicorn \u4e4b\u540e\u7528 gunicorn \u65e0\u6cd5\u542f\u52a8\u7a0b\u5e8f\uff0c\u56e0\u4e3a\u5b83\u7406\u8bba\u4e0a\u5e94\u8be5\u653e\u4e00\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u5230 \/usr\/local\/bin \u91cc\u7684\uff0c\u4f46\u662f\u5b9e\u9645\u4e0a\u5e76\u6ca1\u6709\u3002\u800c\u4e14\u5c31\u7b97\u653e\u4e86\uff0c\u5982\u679c\u6211\u4e4b\u524d\u5728 python3 \u4e0a\u5b89\u88c5\u8fc7 gunicorn\uff0c\u8fd9\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u53c8\u7b97\u8c01\u7684\u5462\uff1f<\/p>\n<p>\u4e4b\u540e\u8bd5\u4e86\u8bd5\u865a\u62df\u73af\u5883\uff0cvenv \u641e\u4e86\u4e2a\u865a\u62df\u73af\u5883\uff0c\u865a\u62df\u73af\u5883\u4e0b\u5b89\u88c5 gunicorn \u770b\u770b\u80fd\u4e0d\u80fd\u6dfb\u52a0\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002\u8bd5\u4e86\u8bd5\u8fd8\u662f\u4e0d\u884c\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4175930\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : arischow <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u60f3\u8bf7\u6559\uff0c\u8fd9\u4e2a\u4e8b\u60c5\u6027\u80fd\u74f6\u9888\u5728 gunicorn \u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4175931\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : linw1995 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u6ca1\u6709\u6392\u67e5\u8fc7\uff0c\u662f\u4e0d\u662f\u5728\u534f\u7a0b\u4e2d\u8c03\u7528\u4e86\u8017\u65f6\u8f83\u957f\u65f6\u95f4\u7684\u540c\u6b65\u51fd\u6570\u3002\u53ef\u4ee5\u7528 debug mode \u6392\u67e5\u4e00\u4e0b\u662f\u4e0d\u662f\u8fd9\u4e2a\u95ee\u9898<\/p>\n<p>https:\/\/docs.python.org\/3\/library\/asyncio-dev.html#debug-mode                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4175932\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u4e2a\u53ef\u80fd\u4e0d\u5bf9\u7684\u5efa\u8bae\uff1a\u628a\u8017\u65f6\u957f\u7684\u8ba1\u7b97\u6a21\u5757\u72ec\u7acb\u51fa\u6765\uff0c\u7528 pypy \u8dd1\uff0c\u5229\u7528\u5b83\u63d0\u901f\uff08\u4f60\u6700\u597d benchmark \u4e00\u4e0b\u63d0\u901f\u6548\u679c\uff09\uff1b\u53e6\u7528 gunicorn \u8dd1\u4e00\u4e2a web \u670d\u52a1\u5668\uff0c\u4e24\u8005\u7528\u67d0\u79cd\u534f\u8bae\u5982 RPC \u901a\u8baf\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4175933\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : black11black <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nonduality <br \/>\u5927\u90e8\u5206\u662f\u5b57\u5178\u64cd\u4f5c\uff0c\u63d0\u901f\u5927\u6982 5 \u79d2\u53d8 2 \u79d2\u7684\u7a0b\u5ea6\u5427\uff0c\u672a\u53ca\u9884\u671f\u4f46\u662f\u5df2\u7ecf\u6ee1\u610f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4175934\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @black11black \u6211\u8bf4\u628a\u8ba1\u7b97\u6a21\u5757\u72ec\u7acb\u51fa\u6765\uff0c\u662f\u60f3\u8ba9\u7eaf Py \u7684\u4ee3\u7801\u80fd\u7528 PyPy \u52a0\u901f\uff0c\u800c Gunicorn \u5219\u7528 CPython \u8dd1\uff0c\u4e24\u8005\u4e92\u4e0d\u5f71\u54cd\u3002\u7528 RPC \u901a\u8baf\u662f\u975e\u5e38\u7b80\u5355\u7684\uff0c\u628a\u8ba1\u7b97\u6a21\u5757\u7b80\u5355\u5305\u88c5\u4e00\u4e0b\u5c31\u53ef\u4ee5\uff0c\u7528\u6765\u63d0\u4ea4\u8ba1\u7b97\u4efb\u52a1\u5e76\u53d6\u56de\u8ba1\u7b97\u7ed3\u679c\uff0c\u4e00\u822c\u4e0d\u9700\u8981\u8d85\u8fc7 20 \u884c\u4ee3\u7801\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u4f60\u53ef\u4ee5\u8bfb\u4e0b\u300a\u9ad8\u6027\u80fd Python \u7f16\u7a0b\u300b\uff0c\u91cc\u5934\u4ecb\u7ecd\u4e86\u4e0d\u5c11\u4f18\u5316\u65b9\u6cd5\u3002\u56e0\u4e3a\u6211\u76f8\u4fe1\u4f60\u7684\u4ee3\u7801\u6709\u5f88\u591a\u53ef\u4ee5\u4f18\u5316\u7684\u5730\u65b9\uff0c\u5305\u62ec\u6570\u636e\u8bfb\u53d6\u540e\u7f13\u5b58\u3001\u6539\u53d8\u6570\u636e\u7ed3\u6784\u7b49\u7b49\uff0c\u751a\u81f3\u90fd\u4e0d\u9700\u8981\u7528 PyPy \u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4175935\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : black11black <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nonduality <br \/>\u4f60\u8bf4\u7684\u4e66\u6211\u8bfb\u8fc7\uff0c\u53e6\u5916\u8fd8\u6709\u4e00\u672c\u540d\u5b57\u53cd\u8fc7\u6765\u7684\u53eb python \u9ad8\u6027\u80fd\u3002\u4f60\u8bf4\u7684\u901a\u4fe1\u95ee\u9898\uff0c\u4e3a\u4e86\u5b9e\u73b0\u9ad8\u53ef\u7528\u672c\u8eab\u9700\u8981\u901a\u8baf\u6a21\u5757\u5f02\u6b65 + \u540e\u7aef\u96c6\u7fa4\u5426\u5219\u4f60\u5355\u72ec\u641e\u51fa\u6765\u4e2a\u540c\u6b65\u5355\u8282\u70b9\u5176\u5b9e\u5f88\u5c34\u5c2c\u3002\u6211\u672c\u4eba\u505a\u8fc7 python \u7684\u5f02\u6b65 RPC \u6a21\u5757\u548c go \u5bf9\u63a5\uff0c\u5982\u679c\u4f60\u4e5f\u505a\u8fc7\u7684\u8bdd\u6211\u4e0d\u89c9\u5f97\u4f60\u4f1a\u8ba4\u4e3a\u8fd9\u5957\u4e1c\u897f\u53ef\u4ee5\u5341\u5206\u8f7b\u677e\u4e14\u5341\u5206\u53ef\u9760\u5730\u63a5\u5230\u590d\u6742\u7cfb\u7edf\u91cc\uff0c\u672c\u8eab\u4f60\u7684\u670d\u52a1\u5c31\u4e0d\u662f\u4e00\u4e2a\u5355\u8282\u70b9\u6a21\u578b\u3002<\/p>\n<p>\u4ed6\u90a3\u4e9b\u4e66\u91cc\u5199\u7684\u52a0\u901f\u65b9\u6cd5\u786e\u5b9e\u6709\u7528\uff0c\u4f46\u662f\u5f88\u591a\u65f6\u5019\u6211\u4eec\u6ca1\u6709\u7cbe\u529b\u53bb\u505a\u4f18\u5316\uff0c\u4e00\u4e2a\u6700\u5c34\u5c2c\u7684\u95ee\u9898\u662f\u5982\u679c\u6211\u4e0d\u6ce8\u91cd\u5f00\u53d1\u6548\u7387\u90a3\u4e48\u662f\u4ec0\u4e48\u539f\u56e0\u4fc3\u4f7f\u6211\u9009\u62e9 python \u7684\u5462\uff1f\u6240\u4ee5\u5927\u90e8\u5206\u65f6\u5019\u53ea\u4f1a\u9009\u62e9\u4e00\u4e9b\u5f00\u7bb1\u5373\u7528\u7684\u52a0\u901f\u65b9\u5f0f\uff0c\u5305\u62ec pypy3 \u4e5f\u6709\u5f88\u591a\u5947\u5999\u7684 bug\uff0c\u53ea\u80fd\u8bf4\u80fd\u8dd1\u4e5f\u5f97\u6d4b\u8bd5\u7a33\u5b9a\u6027\u95ee\u9898                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Gunicorn \u80fd\u4e0d\u80fd\u5728 pyp&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/193082"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193082"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/193082\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193082"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}