How do I throttle my site's API users?

后端 未结 6 1132
无人共我
无人共我 2020-11-28 01:35

The legitimate users of my site occasionally hammer the server with API requests that cause undesirable results. I want to institute a limit of no more than say one API call

6条回答
  •  萌比男神i
    2020-11-28 01:51

    I don't know if this thread is still alive or not but I would suggest to keep these statistics in memory cache like memcached. This will reduce the overhead of logging the request to the DB but still serve the purpose.

提交回复
热议问题