3

I am developing a Python-Django web app. It lets people visiting my site to embed an already created poll widget to their sites. The problem is when a visitor embeds a poll in a site that has much traffic - so that many people vote on the poll at the same time. It can lead to overload and I don't know how to handle that.

My site is hosted on shared hosting. The server is Apache with mod_fcgid. Database is MySQL.

Would someone give me a piece of advice what to do in such situation?

Thank you!

forbdn
  • 186
  • 1
  • 6
  • You need to figure out what you want to limit. I.e. is it database hits that are the problem? Just raw #HTTP reqs/minute? Etc. And then from that determine what you want users to see when you are limiting, and then your ultimate solution. – dkamins Feb 07 '12 at 17:59

2 Answers2

0

Without getting into rationalizing why you see this is a problem, I suggest you look into one of the many throttling modules for apache, here's a similar question:

How can I implement rate limiting with Apache? (requests per second)

Community
  • 1
  • 1
Rafael Ferreira
  • 1,260
  • 8
  • 11
  • I see that a problem because as I mentioned my site is on shared hosting. I am not sure if there is a possibility to use one of these modules for Apache... Should I implement some form of **rate limiting** or should I use **threading**, or some sort of **queue**? I just don't want a phone call from the hosting company telling me I have exceeded the resources I have. – forbdn Feb 05 '12 at 11:06
0

I continued investigating on the problem and found the presentation of Mike Malone (Pownce.com) on "Scaling Django Web Apps". While he talks mostly about really high traffic web apps, some of the pointed solutions can be applied in my sitiation too.

Thank you all for the help!

forbdn
  • 186
  • 1
  • 6