How New Relic Limits API Overloading—And You Can, Too!
Blog post from New Relic
APIs are increasingly essential for businesses to efficiently interact with customers and partners, but managing API usage to prevent overloading is a growing challenge. New Relic addresses this by employing various techniques to limit resource usage and mitigate overloads, including separating API and UI hardware resources and using Unicorn web servers for request handling. The company developed an API Overload Protection tool that tracks usage per API key and restricts access if usage becomes excessive. This tool operates independently of the application to protect against application failures, utilizing nginx to monitor API access and timing. A recent internal investigation revealed discrepancies between reported and actual API usage, attributed to client-imposed timeouts impacting nginx's logging and leading to inaccurate data reporting. The solution involved adjusting nginx's configuration to ensure more accurate tracking of API usage, highlighting the importance of robust monitoring systems as API use continues to grow.