The background is like this, tool in the last two days. lu's uv does not increase significantly, but pv increases greatly, resulting in the server load exceeding 20 at a time. It must have been attacked and optimized by php-fpm, little effect. So I thought of the Use scenario of throttling and limiting the number of API calls to prevent frequent refresh of etc...
The background is like this, tool in the last two days. lu's uv does not increase significantly, but pv increases greatly, resulting in the server load exceeding 20 at a time. It must have been attacked and optimized by php-fpm, little effect. So I thought of the Use scenario of throttling and limiting the number of API calls to prevent frequent refresh of etc...
Background
This is the case. tool has been used in the last two days. lu's uv does not increase significantly, but pv increases greatly, resulting in the server load exceeding 20 at a time. It must have been attacked and optimized by php-fpm, little effect. So I thought of throttling.
Use Cases of throttling
- Limit on the number of API calls
- Prevent frequent refresh
- Etc...
Ideas and Implementations
In fact, I have referred to the implementation of the following article. As to why I want to do so, my consideration is the same as that mentioned in his article. You can view the original article.
Rate limiting with Redis
The original text provides a large text description, so I made a picture based on his description for your reference only:
Original article address: Use redis for throttling. Thank you for sharing it with the original author.