[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-18 UTC。"],[[["\u003cp\u003eThis document covers Apigee and Apigee hybrid documentation, specifically focusing on the Quota policy for managing API request limits.\u003c/p\u003e\n"],["\u003cp\u003eWhen multiple Message Processors serve API requests, each maintains an independent quota count, which can lead to exceeding the intended total request limit.\u003c/p\u003e\n"],["\u003cp\u003eThe impact of independent quota counts across message processors includes potential stress on backend servers and possible 503 errors due to excessive traffic.\u003c/p\u003e\n"],["\u003cp\u003eSetting the \u003ccode\u003e<Distributed>\u003c/code\u003e element to \u003ccode\u003etrue\u003c/code\u003e within the Quota policy ensures a unified counter across all Message Processors, aligning the actual request limit with the configured quota.\u003c/p\u003e\n"]]],[],null,["*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/antipatterns/non-distributed-quota) documentation.*\n\nApigee provides the ability to configure the number of allowed requests to an API Proxy for\na specific period of time using the [Quota policy](/apigee/docs/api-platform/reference/policies/quota-policy).\n\nAntipattern\n\nAn API proxy request can be served by one or more distributed Apigee components called\n*Message Processors*. If there are multiple Message Processors configured for serving API\nrequests, then the quota will likely be exceeded because each Message Processor keeps it's own\n\"count\" of the requests it processes.\n\nLet's explain this with the help of an example. Consider the following [Quota policy](/apigee/docs/api-platform/reference/policies/quota-policy) for an API\nproxy: \n\n```world-of-warcraft-toc\n\u003c!-- /antipatterns/examples/1-6.xml --\u003e\n\u003cQuota name=\"CheckTrafficQuota\"\u003e\n \u003cInterval\u003e1\u003c/Interval\u003e\n \u003cTimeUnit\u003ehour\u003c/TimeUnit\u003e\n \u003cAllow count=\"100\"/\u003e\n\u003c/Quota\u003e\n```\n\nThe above configuration should allow a total of 100 requests per hour.\n\nIn practice, however, when multiple message processors are serving the API requests, the\nfollowing happens:\n\nIn the above illustration:\n\n- The quota policy is configured to allow 100 requests per hour.\n- The requests to the API Proxy are being served by two Message Processors.\n- Each Message Processor maintains its own quota count variable, `quota_count_mp1` and `quota_count_mp2`, to track the number of requests they are processing.\n- Therefore each of the Message Processor will allow 100 API requests separately. The net effect is that a total of 200 requests are processed instead of 100 requests.\n\nImpact\n\nThis situation defeats the purpose of the quota configuration and can have detrimental effects on\nthe backend servers that are serving the requests.\n\nThe backend servers can:\n\n- Be stressed due to higher than expected incoming traffic\n- Become unresponsive to newer API requests leading to 503 errors\n\nBest Practice\n\nConsider, setting the `\u003cDistributed\u003e` element to `true` in the [Quota policy](/apigee/docs/api-platform/reference/policies/quota-policy) to\nensure that a common counter is used to track the API requests across all Message Processors.\nThe `\u003cDistributed\u003e` element can be set as shown in the code snippet below: \n\n```world-of-warcraft-toc\n\u003c!-- /antipatterns/examples/1-7.xml --\u003e\n\u003cQuota name=\"CheckTrafficQuota\"\u003e\n \u003cInterval\u003e1\u003c/Interval\u003e\n \u003cTimeUnit\u003ehour\u003c/TimeUnit\u003e\n \u003cDistributed\u003etrue\u003c/Distributed\u003e\n \u003cAllow count=\"100\"/\u003e\n\u003c/Quota\u003e\n```"]]