با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
سهمیهها از زیرساخت Google در برابر فرآیندهای خودکاری که از Google Bid Manager API به روشی نامناسب استفاده میکنند محافظت میکند. آنها اطمینان می دهند که اقدامات یک توسعه دهنده نمی تواند تأثیر منفی بر جامعه بزرگتر بگذارد.
محدودیت های سهمیه
محدودیتهای سهمیه پیشفرض زیر توسط همه منابع و روشهای Bid Manager API مشترک است.
در Google API Console این سهمیه به عنوان Queries در دقیقه برای هر کاربر نامیده می شود و روی 240 تنظیم شده است.
فراتر از حد نصاب
در صورتی که درخواست شما به دلیل فراتر رفتن از حد مجاز ناموفق باشد، API یک کد وضعیت HTTP و دلیل خطا را برمیگرداند. علاوه بر این، بدنه پاسخ حاوی شرح مفصلی از آنچه باعث خطا شده است. برای نمونه پاسخ خطا به راهنمای پیام های خطا مراجعه کنید.
لیست زیر خطاهای احتمالی و اقدامات توصیه شده برای شکست درخواست ناشی از فراتر از حد مجاز را نشان می دهد.
سرعت ارسال درخواست ها را با استفاده از عقب نشینی نمایی کاهش دهید.
عقب نشینی نمایی چیست؟
عقب نشینی نمایی یک استراتژی استاندارد مدیریت خطا برای برنامه های کاربردی شبکه است که در آن کلاینت به طور دوره ای یک درخواست ناموفق را در مدت زمان فزاینده ای تکرار می کند. اگر حجم بالای درخواستها یا ترافیک شبکه سنگین باعث شود سرور خطاها را برگرداند، پسانداز نمایی ممکن است استراتژی خوبی برای رسیدگی به این خطاها باشد. برعکس، این یک استراتژی مناسب برای برخورد با خطاهای غیرمرتبط با حجم شبکه یا زمان پاسخ، مانند اعتبارنامه های مجوز نامعتبر یا خطاهای یافت نشدن فایل نیست.
اگر به درستی استفاده شود، پسانداز نمایی کارایی استفاده از پهنای باند را افزایش میدهد، تعداد درخواستهای مورد نیاز برای دریافت پاسخ موفقیتآمیز را کاهش میدهد و توان عملیاتی درخواستها را در محیطهای همزمان به حداکثر میرساند.
جریان برای پیاده سازی عقب نشینی نمایی ساده به شرح زیر است:
یک درخواست به API بدهید.
پاسخ HTTP 503 را دریافت کنید، که نشان می دهد باید درخواست را دوباره امتحان کنید.
1 ثانیه + random_number_milliseconds صبر کنید و دوباره درخواست را امتحان کنید.
پاسخ HTTP 503 را دریافت کنید، که نشان می دهد باید درخواست را دوباره امتحان کنید.
2 ثانیه + random_number_milliseconds صبر کنید و دوباره درخواست را امتحان کنید.
پاسخ HTTP 503 را دریافت کنید، که نشان می دهد باید درخواست را دوباره امتحان کنید.
4 ثانیه + random_number_milliseconds صبر کنید و دوباره درخواست را امتحان کنید.
پاسخ HTTP 503 را دریافت کنید، که نشان می دهد باید درخواست را دوباره امتحان کنید.
۸ ثانیه + random_number_milliseconds صبر کنید و دوباره درخواست را امتحان کنید.
پاسخ HTTP 503 را دریافت کنید، که نشان می دهد باید درخواست را دوباره امتحان کنید.
16 ثانیه + random_number_milliseconds صبر کنید و دوباره درخواست را امتحان کنید.
متوقف کردن. یک خطا را گزارش یا ثبت کنید.
در جریان فوق، random_number_milliseconds تعداد تصادفی میلیثانیهها کمتر یا مساوی 1000 است. این امر ضروری است، زیرا وارد کردن یک تاخیر تصادفی کوچک به توزیع یکنواخت بار و جلوگیری از احتمال ضربه زدن به سرور کمک میکند. مقدار random_number_milliseconds باید بعد از هر انتظار دوباره تعریف شود.
توجه: انتظار همیشه (2 ^ n) + random_number_milliseconds است، که در آن n یک عدد صحیح افزایشی یکنواخت است که در ابتدا 0 تعریف شده است. عدد صحیح n برای هر تکرار (هر درخواست) 1 افزایش می یابد.
الگوریتم تنظیم شده است تا زمانی که n 5 باشد خاتمه یابد. این سقف مانع از تلاش مجدد مشتریان برای بی نهایت می شود و منجر به تأخیر کلی در حدود 32 ثانیه قبل از اینکه یک درخواست "خطایی غیرقابل جبران" تلقی شود، می شود. حداکثر تعداد بیشتری از تلاش های مجدد خوب است، به خصوص اگر یک آپلود طولانی در حال انجام باشد. فقط مطمئن شوید که تاخیر تلاش مجدد را در چیزی معقول، مثلاً کمتر از یک دقیقه محدود کنید.
درخواست سهمیه روزانه اضافی
اگر فکر میکنید که درخواست شما به سهمیه روزانه اضافی نیاز دارد، میتوانید با دنبال کردن دستورالعملهای زیر بیشتر درخواست کنید.
دستورالعمل های زیر فقط برای پروژه هایی اعمال می شود که با خطای dailyLimitExceeded مواجه شده اند. اقدامات توصیه شده برای سایر خطاهای سهمیه در جدول بالا پوشش داده شده است.
آمار استفاده خود را از صفحه Metrics مرور کنید تا مطمئن شوید برنامه شما مطابق انتظار عمل می کند. قبل از ادامه، به روش هایی که فراخوانی شده اند دقت کنید و هرگونه استفاده غیرمنتظره یا بیش از حد را برطرف کنید.
اگر استفاده عادی به نظر می رسد، به صفحه سهمیه ها بروید، روی نماد ویرایش در کنار Queries per day کلیک کنید و روی پیوند "درخواست برای سهمیه بالاتر" کلیک کنید.
قبل از ارسال درخواست افزایش، حتماً اطلاعات را بررسی کرده و دستورالعملهای موجود در فرم درخواست سهمیه را دنبال کنید.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eGoogle Bid Manager API uses quotas to protect its infrastructure and ensure fair usage for all developers.\u003c/p\u003e\n"],["\u003cp\u003eDefault quota limits include 2,000 requests per project per day and 4 queries per second per project.\u003c/p\u003e\n"],["\u003cp\u003eExceeding quota limits results in specific error codes, requiring actions like reducing requests or using exponential backoff.\u003c/p\u003e\n"],["\u003cp\u003eExponential backoff is a retry strategy for handling temporary errors by gradually increasing wait times between requests.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can request additional daily quota through the Google API Console if needed.\u003c/p\u003e\n"]]],["Google Bid Manager API uses quotas to protect its infrastructure, limiting projects to 2,000 daily requests and 4 queries per second. Exceeding these results in errors; `dailyLimitExceeded` requires usage examination and possible quota increase, while `userRateLimitExceeded` needs rate slowdown via exponential backoff. Exponential backoff retries failed requests with increasing delays (e.g., 1, 2, 4 seconds) and randomized milliseconds, terminating after a set number of attempts. Additional daily quota can be requested through the Google API Console.\n"],null,["# Quotas protect Google's infrastructure from automated processes that use the Google Bid Manager API in an inappropriate way. They ensure that one developer's actions cannot negatively impact the larger community.\n\nQuota limits\n------------\n\nThe following default quota limits are shared by all Bid Manager API resources and methods.\n\n- 2,000 requests per project per day - [can be increased](#additional_quota).\n- 4 queries per second (QPS) per project.\n - In the Google API Console this quota is referred to as **Queries per minute per user**, and is set to 240.\n\n| **Note:** Daily quotas refresh at midnight PST.\n\nExceeding quota limits\n----------------------\n\nIn the unlikely event that your request fails due to exceeding a quota limit, the API returns an HTTP status code and reason for the error. Additionally, the body of the response contains a detailed description of what caused the error. See the [Error Messages](/bid-manager/core_errors) guide for an example error response.\n\nThe following list shows the possible errors and recommended actions for request failures caused by exceeding quota limits.\n\n| Code | Reason | Message | Recommended Action |\n|------|-----------------------|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 403 | dailyLimitExceeded | Daily Limit Exceeded | Do not retry without fixing the problem. [Examine your usage](https://console.developers.google.com/project/_/apiui/apiview/doubleclickbidmanager/metrics) from the Google API Console and modify your workflow to make fewer requests. You can [request additional quota](#additional_quota) if you believe your usage is reasonable. |\n| 403 | userRateLimitExceeded | User Rate Limit Exceeded | Slow down the rate at which you are sending requests using [exponential backoff](#exponential_backoff). |\n\n#### What is exponential backoff?\n\nExponential backoff is a standard error handling strategy for network applications in which the client periodically retries a failed request over an increasing amount of time. If a high volume of requests or heavy network traffic causes the server to return errors, exponential backoff may be a good strategy for handling those errors. Conversely, it is not a relevant strategy for dealing with errors unrelated to network volume or response times, such as invalid authorization credentials or file not found errors.\n\nUsed properly, exponential backoff increases the efficiency of bandwidth usage, reduces the number of requests required to get a successful response, and maximizes the throughput of requests in concurrent environments.\n\nThe flow for implementing simple exponential backoff is as follows:\n\n1. Make a request to the API.\n2. Receive an `HTTP 503` response, which indicates you should retry the request.\n3. Wait 1 second + random_number_milliseconds and retry the request.\n4. Receive an `HTTP 503` response, which indicates you should retry the request.\n5. Wait 2 seconds + random_number_milliseconds, and retry the request.\n6. Receive an `HTTP 503` response, which indicates you should retry the request.\n7. Wait 4 seconds + random_number_milliseconds, and retry the request.\n8. Receive an `HTTP 503` response, which indicates you should retry the request.\n9. Wait 8 seconds + random_number_milliseconds, and retry the request.\n10. Receive an `HTTP 503` response, which indicates you should retry the request.\n11. Wait 16 seconds + random_number_milliseconds, and retry the request.\n12. Stop. Report or log an error.\n\nIn the above flow, random_number_milliseconds is a random number of milliseconds less than or equal to 1000. This is necessary, since introducing a small random delay helps distribute the load more evenly and avoid the possibility of stampeding the server. The value of random_number_milliseconds must be redefined after each wait.\n\n**Note:**The wait is always (2 \\^ n) + random_number_milliseconds, where n is a monotonically increasing integer initially defined as 0. The integer n is incremented by 1 for each iteration (each request).\n\nThe algorithm is set to terminate when n is 5. This ceiling prevents clients from retrying infinitely, and results in a total delay of around 32 seconds before a request is deemed \"an unrecoverable error.\" A larger maximum number of retries is fine, especially if a long upload is in progress; just be sure to cap the retry delay at something reasonable, say, less than one minute.\n\nRequesting additional daily quota\n---------------------------------\n\nIf you think that your application requires additional daily quota, you can request more by following the instructions below.\n\nThe following instructions only apply to projects that have encountered a `dailyLimitExceeded` error. Recommended actions for other quota errors are covered in the [table above](#exceeding_limits).\n\n1. Navigate to the [Bid Manager API](https://console.developers.google.com/project/_/apiui/apiview/doubleclickbidmanager/quotas) in the Google API Console.\n2. Review your usage statistics from the **Metrics** page to ensure your application is behaving as expected. Pay close attention to the methods that have been called and address any unexpected or excessive usage before proceeding.\n3. If usage looks normal, navigate to the **Quotas** page, click the edit icon next to **Queries per day** and click the link to \"Apply for higher quota\".\n\nMake sure to review the information and follow the instructions included in the quota request form before submitting an increase request.\n| **Note:** The email address you provide must be one that you actively monitor, as a representative may reach out to gather additional information."]]