7

My app is occasionally (once per day) running a bulk insert of around 1,000 files. After a handful of inserts I start getting 403 rate limit responses. Since my app does the inserts sequentially, my attempted insert rate is never higher than 1 per second.

I've checked that I have billing enabled and that my quota limits are 100+ per second, so I don't understand why I'm getting throttled so aggressively. The consequence is that the insert is taking over an hour which isn't a great advert for Drive :-(

pinoyyid
  • 21,499
  • 14
  • 64
  • 115

3 Answers3

4

Seems the answer is that Drive will allow up to 30 or so inserts before rejecting with 403 errors. The precise figure, and the rate at which the rate limit is de-restricted are not made public. See also 403 rate limit on insert sometimes succeeds

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
  • were you getting `rateLimitExceeded` or `userRateLimitExceeded`? At least now, it seems you can set the per-user request limit arbitrarily in the API console. Increasing that should help decrease the occurrence of `userRateLimitExceeded` exceptions if I've understood it correctly – Don Cheadle Apr 28 '15 at 14:30
2

You need to implement exponential backoff as Google describes in their documentation.

Jay Lee
  • 13,415
  • 3
  • 28
  • 59
  • 1
    I realise that. I often end up backing off for 4 seconds. The point of the question is to ask if the insert rate of Drive is really < 1 insert per second since if true, I need to completely redesign my app. – pinoyyid Sep 01 '13 at 03:06
-2

You can change the rate in the api console. Set it to a larger value like 10000/sec.

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36