How can I tell if I'm exceeding the api rate? http response code? X-Timing-Stats header?

16 views
Skip to first unread message

George Lawrence

unread,
Jan 5, 2012, 8:12:34 PM1/5/12
to simp...@googlegroups.com
I'm using the Java SimpleGeoStorageClient to send a few thousand Record objects through calls to addOrUpdateRecords().  I'm sending 100 records per call.

Everything works great for a few minutes, then I start getting back response code 400 to all the requests.

I signed up for a Basic account, so I get 5 calls a second.  And I make sure that I wait at least 200ms between calls to addOrUpdateRecords().

So...

1. When sending 100 records through a single call to addOrUpdateRecords() does that count as 1 call, or 100?

2. Does the 400 response indicate that I'm calling too often?

3. X-Timing-Stats header looks interesting, but I'm not sure how to interpret the meaning of the value of the header.  Is that something you could explain?

4. I assumed that it wasn't possible to exceed the rate... i.e. if i go past what my plan includes, don't you just charge me more?  Or is the fact that I'm still within the 60 day free window affect that formula?


Anyway, if switching to the next plan up with solve my problem, I'm happy to do it.  I just want to understand it a bit better before I do.

Thanks for your help!  Totally appreciated!

-- George


Wade Simmons

unread,
Jan 6, 2012, 1:56:04 PM1/6/12
to simp...@googlegroups.com
On Thu, Jan 5, 2012 at 5:12 PM, George Lawrence <georgel...@gmail.com> wrote:
1. When sending 100 records through a single call to addOrUpdateRecords() does that count as 1 call, or 100?

That counts as 1 call.
 
2. Does the 400 response indicate that I'm calling too often?

You will get a 402 response code when you hit the rate limit. If you are getting a 400, it means that something was bad in the request and you should look at the body of the request to see what the error is.
 
3. X-Timing-Stats header looks interesting, but I'm not sure how to interpret the meaning of the value of the header.  Is that something you could explain?

X-Timing-Stats shows how long the request took in different parts of the backend. We use this info when diagnosing timeouts / performance issues.
 
4. I assumed that it wasn't possible to exceed the rate... i.e. if i go past what my plan includes, don't you just charge me more?  Or is the fact that I'm still within the 60 day free window affect that formula?

If you go over the Monthly call amount for your plan listed here https://simplegeo.com/pricing/ you will be charged based on the "additional API calls" table at the bottom of the page. Any requests that exceed the per second limit will be rejected with an HTTP 402 error. I hope that helps

Best,
Wade

Reply all
Reply to author
Forward
0 new messages