日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

gevent+django并发资料调研

發布時間:2023/12/31 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 gevent+django并发资料调研 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

下面是百度和Google上面的所有關于gevent+Django的調研:

百度搜索django gevent,然后下面是百度前10頁的所有相關鏈接(有些博主自己都沒搞懂asyncio異步和celery異步啥區別的,我直接刪除)

Google搜索django gevent,返回前面幾頁的相關結果。

上述搜索結果我全部羅列到了下面的 References中

可能可以落地的是:

[1][4][6][8][13][29]

其中有完整例子的是:

[6][13][29]

#-----------------------------------我自己的實測結果-----------------------------------------------------------------------------

下面表格中的transaction rate是并發數量

測試方式結果壓測時間
python manage runserverTransactions:?? ??? ? ? ? ? ?5362 hits
Availability:?? ??? ? ? ? ?100.00 %
Elapsed time:?? ??? ? ? ? ? 25.37 secs
Data transferred:?? ? ? ? ? ?0.07 MB
Response time:?? ??? ? ? ? ? ?0.56 secs
Transaction rate:?? ? ? ? ?211.35 trans/sec
Throughput:?? ??? ? ? ? ? ?0.00 MB/sec
Concurrency:?? ??? ? ? ? ?118.34
Successful transactions: ? ? ? ?5362
Failed transactions:?? ? ? ? ? ? ? 0
Longest transaction:?? ? ? ? ? 14.92
Shortest transaction:?? ? ? ? ? ?0.00
?
脈搏約30下

gunicorn + gevent

Transactions:?? ??? ? ? ? ? ?6884 hits
Availability:?? ??? ? ? ? ?100.00 %
Elapsed time:?? ??? ? ? ? ? 42.47 secs
Data transferred:?? ? ? ? ? ?0.09 MB
Response time:?? ??? ? ? ? ? ?1.53 secs
Transaction rate:?? ? ? ? ?162.09 trans/sec
Throughput:?? ??? ? ? ? ? ?0.00 MB/sec
Concurrency:?? ??? ? ? ? ?247.45
Successful transactions: ? ? ? ?6884
Failed transactions:?? ? ? ? ? ? ? 0
Longest transaction:?? ? ? ? ? 20.58
Shortest transaction:?? ? ? ? ? ?0.09
脈搏約30下
gunicorn+gthreadTransactions:?? ??? ? ? ? ? ?7050 hits
Availability:?? ??? ? ? ? ? 99.27 %
Elapsed time:?? ??? ? ? ? ? 21.18 secs
Data transferred:?? ? ? ? ? ?0.94 MB
Response time:?? ??? ? ? ? ? ?0.75 secs
Transaction rate:?? ? ? ? ?332.86 trans/sec
Throughput:?? ??? ? ? ? ? ?0.04 MB/sec
Concurrency:?? ??? ? ? ? ?250.20
Successful transactions: ? ? ? ?7050
Failed transactions:?? ? ? ? ? ? ?52
Longest transaction:?? ? ? ? ? ?2.41
Shortest transaction:?? ? ? ? ? ?0.21
?
脈搏約30下

gunicorn + gthread + CONN_MAX_AGE

Transactions:?? ??? ? ? ? ? 12300 hits
Availability:?? ??? ? ? ? ? 97.19 %
Elapsed time:?? ??? ? ? ? ? 23.06 secs
Data transferred:?? ? ? ? ? ?5.99 MB
Response time:?? ??? ? ? ? ? ?0.47 secs
Transaction rate:?? ? ? ? ?533.39 trans/sec
Throughput:?? ??? ? ? ? ? ?0.26 MB/sec
Concurrency:?? ??? ? ? ? ?252.72
Successful transactions: ? ? ? 12300
Failed transactions:?? ? ? ? ? ? 356
Longest transaction:?? ? ? ? ? ?1.57
Shortest transaction:?? ? ? ? ? ?0.03

上述并發中出現不少掛掉的:

脈搏約30下

gunicorn+gevent+

CONN_MAX_AGE

?這個結果還是算了吧,明顯不靠譜脈搏約30下

?

完整測試過程與測試代碼:

https://github.com/appleyuchi/django_gevent_test

后來聯系上了最初的代碼作者,作者說,壓測是本地機子對云主機進行的,而不是本地機對本地機進行的。

gevent+django的效果只是看上去跑的通,其實效果并沒有提升。

作者說:要注意第三方的api的壓測結果,再考慮接入第三方api。

--------------------------------------

Django+gevent/Asyncio這種組合方式目前是不行的,py的web想要并發幾乎必須是tornado/sanic

?

Reference:

[1]Django Gevent integration(stackoverflow)

[2]如何提高django的并發能力(與[29]一致)

[3]gevent+django的坑(不行)

[4]how to combine django plus gevent the basics?(stackoverflow)

[5]gevent(沒啥用)

[6]async-django-gevent-demo(github上面的一個例子)

[7]利用gevent來配置uwsgi提高django項目并發量(沒有完整代碼)

[8]如何用 gevent 提高 Django 的性能?(zhihu提倡tornado)

[9]django-gevent(作者自己都說不行)

[10]Nginx + Gunicorn(+gevent) + Django(沒有完整例子)

[11]nginx + gevent + django高并發配置 django案例 django建站 django搭(沒啥用)

[12]解決gunicorn+gevent+django數據庫高連接數問題(gevent+django使用中的一個問題,沒有完整例子)

[13]用gunicorn和gevent提高python web框架的性能(Flask+gevent例子)

[14]python用gevent實現異步(沒有涉及web框架)

[15]關于gevent的一些理解(二) (只是測試而已)

[16]django 的并發(沒有完整例子,但是顯然博主理解比較深刻)

[17]django+nginx+supervisor+gunicorn+gevent 網站部署(講了配置,但是沒有完整例子)

[18]Python Gevent – 高性能的 Python 并發框架(這里最后一個例子有提到Flask,但是屬于websockets API)?

[19]誰說gevent不能做web開發的(fastpy框架)

[20]gunicorn+gevent+django+nginx部署體驗(沒有完整實驗)

[21]django + gunicorn +nginx + gevent(沒啥用)

[22]誰說Django搞定不了千萬并發,看你怎么用!(Instagram雖然用了django,但是人家沒接第三方api)

[23]Python協程(gevent+asyncio)模塊(沒有涉及web框架)

[24]利用gunicorn提高django的并發能力(同[29])

[25]同步、異步(gevent,asyncio)、多線程(threading)效率對比(只是稍微提了下Django)

[26]How to make Django works with gevent?(這個討論的是django的websocket api)

[27]Python/Django + Gunicorn with Gevent Workers

[28]python 高性能web框架 gunicorn+gevent

[29]如何提高django的并發能力

?

總結

以上是生活随笔為你收集整理的gevent+django并发资料调研的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。