Google Docs API는 공유 서비스이므로 모든 사용자가 공정하게 사용하고 Google Workspace 시스템의 전반적인 상태를 보호할 수 있도록 할당량과 제한사항이 적용됩니다.
할당량을 초과하면 일반적으로 429: Too many requests HTTP 상태 코드 응답이 표시됩니다. 이 경우 지수 백오프 알고리즘을 사용하고 나중에 다시 시도해야 합니다.
다음 표에는 요청 한도가 자세히 나와 있습니다.
할당량
읽기 요청
프로젝트별 분당 할당량
3000
프로젝트별 사용자당 분당 할당량
300
쓰기 요청
프로젝트별 분당
600
프로젝트별 사용자별 분당
60
시간 기반 할당량 오류 해결
모든 시간 기반 오류 (X분당 최대 N개의 요청)의 경우 코드에서 예외를 포착하고 잘린 지수 백오프를 사용하여 기기에서 과도한 부하를 생성하지 않도록 하는 것이 좋습니다.
지수 백오프는 네트워크 애플리케이션의 표준 오류 처리 전략입니다. 지수 백오프 알고리즘은 요청 간 대기 시간을 기하급수적으로 늘려 최대 백오프 시간까지 요청을 재시도합니다. 요청이 여전히 실패하는 경우 요청이 성공할 때까지 시간이 지남에 따라 요청 간 지연 시간이 늘어나는 것이 중요합니다.
예시 알고리즘
지수 백오프 알고리즘이 재시도 간 대기 시간을 최대 백오프 시간까지 늘려서 기하급수적으로 요청을 재시도합니다. 예를 들면 다음과 같습니다.
Google Docs API에 요청을 전송합니다.
요청이 실패하면 1초 + random_number_milliseconds를 대기한 후 요청을 재시도합니다.
요청이 실패하면 2초 + random_number_milliseconds를 대기한 후 요청을 재시도합니다.
요청이 실패하면 4 + random_number_milliseconds를 대기한 후 요청을 재시도합니다.
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는 모두 추가 비용 없이 사용할 수 있습니다. 할당량 요청 한도를 초과해도 추가 비용이 청구되지 않으며 계정에 비용이 청구되지 않습니다.
할당량 상향 조정 요청
프로젝트의 리소스 사용량에 따라 할당량 증가를 요청할 수 있습니다. 서비스 계정에 의한 API 호출은 단일 계정을 사용하는 것으로 간주됩니다. 할당량 증가를 신청해도 승인된다고 보장할 수 없습니다. 할당량을 크게 늘리려는 경우에는 승인을 받는 데 시간이 더 소요될 수 있습니다.
모든 프로젝트의 할당량이 동일하지는 않습니다. Google Cloud 사용량이 점차 늘어나면 할당량도 늘려야 할 수 있습니다. 앞으로 사용량이 현저하게 늘어날 것으로 예상되는 경우 Google Cloud 콘솔의 할당량 페이지에서 사전에 할당량 조정을 요청할 수 있습니다.
[[["이해하기 쉬움","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(UTC)"],[],[],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)"]]