تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بما أنّ Google Docs API هي خدمة مشترَكة، نطبّق حصصًا وقيودًا
للتأكّد من استخدامها بشكل عادل من قِبل جميع المستخدمين وحماية الحالة العامة
لنظام Google Workspace.
إذا تجاوزت الحصة، ستتلقّى عادةً استجابة رمز حالة HTTP
429: Too many requests. في هذه الحالة، يجب استخدام
خوارزمية التوقف المؤقت المتزايد وإعادة المحاولة
لاحقًا.
يوضّح الجدول التالي حدود الطلبات:
الحصص
قراءة الطلبات
في الدقيقة لكل مشروع
3000
في الدقيقة لكل مستخدم لكل مشروع
300
كتابة الطلبات
في الدقيقة لكل مشروع
600
للدقيقة لكل مستخدم لكل مشروع
60
حلّ أخطاء الحصة المستندة إلى الوقت
بالنسبة إلى جميع الأخطاء المستندة إلى الوقت (الحد الأقصى لطلبات N كل X دقائق)، ننصح
بأن يرصد الرمز البرمجي الاستثناء ويستخدم وقت انتظار متزايد مقطوع للتأكّد من عدم توليد
أجهزتك لحمل زائد.
إنّ التأخير المتزايد هو استراتيجية معالجة أخطاء عادية لتطبيقات الشبكة. تعيد خوارزمية
التراجع الأسي الطلبات باستخدام أوقات انتظار متزايدة بشكلٍ تصاعدي
بين الطلبات، حتى الحد الأقصى لوقت التراجع. إذا استمرت الطلبات غير ناجحة، من
المهم زيادة فترات التأخير بين الطلبات بمرور الوقت إلى أن يصبح الطلب ناجحًا.
مثال على الخوارزمية
تعمل خوارزمية التراجع الأسي على إعادة محاولة الطلبات بشكل متسارع، ما يزيد من وقت الانتظار بين عمليات إعادة المحاولة لتصل إلى الحد الأقصى لوقت التراجع. على سبيل المثال:
قدِّم طلبًا إلى Google Docs API.
إذا تعذّر الطلب، يُرجى الانتظار 1 + random_number_milliseconds
وإعادة محاولة الطلب.
إذا تعذّر إكمال الطلب، انتظِر random_number_milliseconds ثانية أو أكثر وأعِد محاولة
إكماله.
إذا تعذّر إكمال الطلب، انتظِر 4 ثوانٍ أو أكثر ثم أعِد محاولة
إكماله.
وهكذا، يصل إلى مرة واحدة (maximum_backoff).
يُرجى الانتظار وإعادة المحاولة حتى الحد الأقصى لعدد مرات إعادة المحاولة، ولكن لا تزيد مدّة الانتظار
بين عمليات إعادة المحاولة.
حيث:
وقت الانتظار هو min(((2^n)+random_number_milliseconds), maximum_backoff)، مع زيادة n بمقدار 1 لكل تكرار (طلب).
random_number_milliseconds هو عدد عشوائي بالمللي ثانية أقل من أو
يساوي 1,000. ويساعد ذلك في تجنُّب الحالات التي تتم فيها مزامنة العديد من البرامج في حالة معيّنة، وتتم إعادة المحاولة كلها في آنٍ واحد، ما يؤدي إلى إرسال الطلبات على شكل موجات متزامنة. تتم إعادة احتساب قيمة random_number_milliseconds بعد كل
طلب إعادة محاولة.
تكون مدة maximum_backoff عادةً 32 أو 64 ثانية. وتعتمد القيمة المناسبة
على حالة الاستخدام.
يمكن للعميل مواصلة إعادة المحاولة بعد بلوغ الوقت maximum_backoff.
لا تحتاج عمليات إعادة المحاولة بعد هذه المرحلة إلى مواصلة زيادة وقت الانتظار. على سبيل المثال، إذا كان العميل يستخدم وقت maximum_backoff مدته 64 ثانية، بعد الوصول إلى
هذه القيمة، يمكن للعميل إعادة المحاولة كل 64 ثانية. في مرحلة ما،
يجب منع العملاء من إعادة المحاولة إلى أجل غير مسمى.
يعتمد وقت الانتظار بين عمليات إعادة المحاولة وعدد عمليات إعادة المحاولة على حالة الاستخدام
وظروف الشبكة.
الأسعار
يمكنك استخدام Google Docs API بدون أي تكلفة إضافية. لا يؤدي تجاوز الحصة
أو حدود الطلبات إلى تحمُّل رسوم إضافية ولا يتمّ تحصيل رسوم من حسابك.
طلب زيادة في الحصة
استنادًا إلى استخدام مشروعك للموارد، قد تحتاج إلى طلب
زيادة الحصة. تُعتبَر طلبات البيانات من واجهة برمجة التطبيقات التي يقدّمها حساب خدمة أنّها تستخدم
حسابًا واحدًا. ولا يضمن طلب الحصول على حصة زائدة الموافقة. قد تستغرق زيادات
الحصة الكبيرة وقتًا أطول للموافقة عليها.
لا تتوفّر الحصص نفسها في جميع المشاريع. مع زيادة استخدامك لخدمة Google Cloud بمرور
الوقت، قد تحتاج إلى زيادة حصصك. إذا كنت تتوقّع حدوث زيادة ملحوظة في الاستخدام، يمكنك بشكل استباقي
طلب تعديل الحصة
من صفحة "الحصص"
في Google Cloud Console.
لمزيد من المعلومات، يُرجى الاطّلاع على المراجع التالية:
تاريخ التعديل الأخير: 2025-03-22 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-03-22 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Usage limits\n\nAs the Google Docs API is a shared service, we apply quotas and limitations\nto make sure it's used fairly by all users and to protect the overall\nhealth of the Google Workspace system.\n\n\nIf you exceed a quota, you'll generally receive a\n`429: Too many requests`\nHTTP status code response. If this happens, you should use an\n[exponential backoff algorithm](#exponential) and try again\nlater.\n\nThe following table details the request limits:\n\n| Quotas ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------|\n| Read requests | |---------------------------------|------| | Per minute per project | 3000 | | Per minute per user per project | 300 | |\n| Write requests | |---------------------------------|-----| | Per minute per project | 600 | | Per minute per user per project | 60 | |\n\nResolve time-based quota errors\n-------------------------------\n\n\nFor all time-based errors (maximum of N requests per X minutes), we recommend\nyour code catches the exception and uses a *truncated exponential backoff* to make sure your\ndevices don't generate excessive load.\n\n\nExponential backoff is a standard error handling strategy for network applications. An\nexponential backoff algorithm retries requests using exponentially increasing wait times\nbetween requests, up to a maximum backoff time. If requests are still unsuccessful, it's\nimportant that the delays between requests increase over time until the request is successful.\n\n### Example algorithm\n\n\nAn exponential backoff algorithm retries requests exponentially, increasing the wait time\nbetween retries up to a maximum backoff time. For example:\n\n1. Make a request to Google Docs API.\n2. If the request fails, wait 1 + `random_number_milliseconds` and retry the request.\n3. If the request fails, wait 2 + `random_number_milliseconds` and retry the request.\n4. If the request fails, wait 4 + `random_number_milliseconds` and retry the request.\n5. And so on, up to a `maximum_backoff` time.\n6. Continue waiting and retrying up to some maximum number of retries, but don't increase the wait period between retries.\n\n\nwhere:\n\n- The wait time is `min(((2^n)+random_number_milliseconds), maximum_backoff)`, with `n` incremented by 1 for each iteration (request).\n- `random_number_milliseconds` is a random number of milliseconds less than or equal to 1,000. This helps to avoid cases in which many clients are synchronized by some situation and all retry at once, sending requests in synchronized waves. The value of `random_number_milliseconds` is recalculated after each retry request.\n- `maximum_backoff` is typically 32 or 64 seconds. The appropriate value depends on the use case.\n\n\nThe client can continue retrying after it has reached the `maximum_backoff` time.\nRetries after this point don't need to continue increasing backoff time. For\nexample, if a client uses a `maximum_backoff` time of 64 seconds, then after reaching\nthis value, the client can retry every 64 seconds. At some point,\nclients should be prevented from retrying indefinitely.\n\n\nThe wait time between retries and the number of retries depend on your use case\nand network conditions.\n\nPricing\n-------\n\n\nAll use of the Google Docs API is available at no additional cost. Exceeding the quota\nrequest limits doesn't incur extra charges and your account is not billed.\n\nRequest a quota increase\n------------------------\n\n\nDepending on your project's resource usage, you might want to request a quota\nadjustment. API calls by a service account are considered to be using a\nsingle account. Applying for an adjusted quota doesn't guarantee approval. Quota adjustment\nrequests that would significantly increase the quota value can take longer to be approved.\n\n\nNot all projects have the same quotas. As you increasingly use Google Cloud over\ntime, your quota values might need to increase. If you expect a notable upcoming\nincrease in usage, you can proactively\n[request quota adjustments](https://cloud.google.com/docs/quota#requesting_higher_quota)\nfrom the [Quotas page](https://console.cloud.google.com/iam-admin/quotas)\nin the Google Cloud console.\n\nTo learn more, see the following resources:\n\n- [About quota adjustments](https://cloud.google.com/docs/quotas/overview#about_increase_requests)\n- [View your current quota usage and limits](https://cloud.google.com/docs/quota#viewing_your_quota_console)\n- [Request a higher quota limit](https://cloud.google.com/docs/quota#requesting_higher_quota)"]]