TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Handling 100 Requests per Second with Python and Django

50 点作者 davidfischer将近 4 年前

13 条评论

cryptos将近 4 年前
100 requests per second? That is not too impressive. Yes, I know Python is their tool of choice, but it is probably the wrong tool for the problem at hand.<p>There are frameworks that can handle over a million requests per second (simple json output) or at least several 10,000 requests per second if DB queries are performed (even though on different hardware, but just compare the scale).<p><a href="https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r20&amp;hw=ph&amp;test=json" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r20&amp;hw=...</a> <a href="https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r20&amp;hw=ph&amp;test=query" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r20&amp;hw=...</a><p>I think, if performance is a strong requirement, they were better off with another programming language.
评论 #28125715 未加载
评论 #27977148 未加载
评论 #27977437 未加载
评论 #27977948 未加载
fabian2k将近 4 年前
One thing that jumps out at me is that it seems they didn&#x27;t use any Postgres connection pooling. They mention that going above 100 concurrent connection would bump them into a more expensive Postgres plan, which really only makes sense if you don&#x27;t use a pool.<p>My first instinct is that the number of requests seems really low, but I have no idea about the complexity of each request. To me that is kind of a crucial information to actually evaluate anything in the blog post.
评论 #27977195 未加载
评论 #27981282 未加载
ericholscher将近 4 年前
A blog post we recently published talking about scaling up our operations. I love using standard tools (Django, Python, Postgres) to achieve this. Definitely shows that you don&#x27;t need fancy tools until you get huge -- and here is a longer version of that story.
评论 #27977354 未加载
评论 #27976308 未加载
axiosgunnar将近 4 年前
Coming from a node.js world, I thought they meant 100k and the title had a typo.
评论 #27978626 未加载
评论 #27977800 未加载
sbelskie将近 4 年前
&gt; A few months after rolling things out to production we encountered some issues with AppService.<p>I’d be curious to hear more about this. Was is just degraded performance or something else?
评论 #27977170 未加载
no_time将近 4 年前
Forgive me for my ignorance (I&#x27;m not in the saas biz) but $300-$500&#x2F;mo seems eye wateringly expensive for what is essentially static content + abuse detection and metering.<p>less than $100&#x2F;mo buys you an absolute beast of a VPS at some hosting provider that could alone handle way more than that.
评论 #27982005 未加载
nickphx将近 4 年前
I built a project in python using django that handles 11k&#x2F;second. Requires a load balancer and a few machines of course.. :D
zikani_03将近 4 年前
Interesting read.. Have you tried using waitress[0]?<p>We got some better performance for an internal service than Gunicorn after trying different gunicorn configurations to improve the performance of our workloads. We now mostly run (read depend) one instance of that service instead of 3 like we used to before.<p>[0]: <a href="https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;waitress&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;waitress&#x2F;</a>
评论 #27978327 未加载
评论 #27979858 未加载
heavyset_go将近 4 年前
I wonder how much Django&#x27;s async views and ASGI support would affect the request rate.
评论 #27978286 未加载
kofejnik将近 4 年前
if you do blocking DB operations before serving ads, latency won&#x27;t be great. Assuming you don&#x27;t have to wait for transactions to commit, you can probably push required operations onto a queue (Redis would be fine for that) and serve the content immediately?
rachelbythebay将近 4 年前
Note: across multiple machines.
评论 #27977380 未加载
exdsq将近 4 年前
Don&#x27;t most major cloud providers offer multi-region replication to start solving the Europe&#x2F;Asia latency issue?
评论 #27977161 未加载
SilurianWenlock将近 4 年前
Why dont use just use Java?
评论 #27976849 未加载
评论 #27977181 未加载
评论 #27978000 未加载
评论 #27977451 未加载
评论 #27977185 未加载