如何使烧瓶处理25K请求,例如Express.js
因此,我正在制作一个大型的社交媒体应用程序,但是我有一个问题可以选择烧瓶或Express.js。我非常喜欢烧瓶,但不能处理太多的请求。 Express.js每秒可以处理约25K请求(Google)。因此,无论如何,是否有使用Gunicorn使用Gunicorn进行烧瓶处理25K请求,我目前正在使用此命令$ gunicorn -w 4 -b 0.0.0.0.0.0.0.0.0.0.0.0:5000 your_project:app
时间。嗯,还有一个问题一次可以处理100万用户。我应该选择express.js,因为它可以处理25k请求
So i am making a big social media app but i have a problem which framework to choose flask or express.js i like flask so much but it cant handle too much requests. Express.js can handle about 25k request per second (google). So is there anyway to make flask handle 25k request per second using gunicorn currently i am using this command $ gunicorn -w 4 -b 0.0.0.0:5000 your_project:app
but it can only handle 4 request at a time. And uh one more question can flask handle 1Million user at a time. Should i choose express.js because it can handle 25k request
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用多线程或GEVENT来增加枪支的并发性。
option1多线程
例如:
- 线程100
表示每个进程100个线程。因此
-w 4- threads 100
表示400个请求。
-w 4 表示4个进程,
连接1000
表示每个gevent工作过程的1000 coroutines。-w 4
表示4个进程,因此-w 4 -k gevent -worker-connections 1000
一次指4000个请求。有关更多信息,您可以参考我的博客文章: https://easydevguide.com/posts/posts/posts/gunicorn_concurrency
You can use multithreads or gevent to increase gunicorn's concurrency.
Option1 multithreads
eg:
--threads 100
means 100 threads per process.-w 4
means 4 processes, so-w 4 --threads 100
means 400 requests at a timeOption2 gevent worker
eg:
-k gevent --worker-connections 1000
means 1000 coroutines per gevent worker process.-w 4
means 4 processes, so-w 4 -k gevent --worker-connections 1000
means 4000 requests at a time.For more information, you can refer to my blog post: https://easydevguide.com/posts/gunicorn_concurrency