Concurrent load handling in Django

I am using Django for my new web project. Its basically a Quora clone. Lets say I have a question and Upvote button below it. if around 8-9k people simultaneously click on that Upvote button(of the same question), how can I handle it? I am using Nginx as a front-end server and Apache as back-end server? What should I be using to handle that amount of load?


The answer depends on how you store the votes. Before even worrying about the load on the webserver you must make certain that you are not having a race condition.

Given that you don't, an easy boost can be to cache the votes submitted to a key-value store (eg Redis) or even better use it as an aggregator if you have a normalised database.

Another option is to use Celery's asynchronous tasks to queue the votes.

链接地址: http://www.djcxy.com/p/86452.html

上一篇: Flask SocketIO将消息从服​​务器发送到空间

下一篇: Django中的并发加载处理