2

I want to be able to say that if a request from the same user (for an API) starts to happen quickly enough that their requests per minute reaches a certain level, I want to start denying the requests until it slows down. (Just like the guys at Zendesk did).

The question is two fold, what's an efficient way of calculating the request rate (minimal DB read/writes) and where in the MVC hierarchy (Action filter, Controller method override?) would this code best reside?

MetaGuru
  • 42,847
  • 67
  • 188
  • 294
  • 2
    http://stackoverflow.com/questions/33969/best-way-to-implement-request-throttling-in-asp-net-mvc – Matthew Abbott Aug 18 '11 at 20:12
  • @MatthewAbbott Thanks much, not sure how I missed that one the search I made only found PHP results, voted to close as duplicate. – MetaGuru Aug 18 '11 at 20:22

1 Answers1

0

Two words, Reactive Framework.

It has all sorts of candy and sugary syntax to get throttling and managing of events to become less and less of a head ache, while I would bet will trickle back through and kill some complexity down stream.

Jake Kalstad
  • 2,045
  • 14
  • 20
  • http://msdn.microsoft.com/en-us/data/gg577609 Download that and google a tutorial on using it, its similar to using linq on lists but its pushing events at you instead of you pulling elements out. – Jake Kalstad Aug 18 '11 at 20:17