wit icon indicating copy to clipboard operation
wit copied to clipboard

Posting more than 200 samples through POST /samples endpoint hits rate limit

Open jaisrael1 opened this issue 8 years ago • 5 comments

Do you want to request a feature, report a bug, or ask a question about wit?

Ask a question/report a bug

What is the current behavior?

When I train a wit app through the POST /samples API endpoint, if there are more than 200 samples it fails with 'You exceeded the limit of 200 samples per min'.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Programatically post 201 samples to a wit app.

What is the expected behavior?

I created a wit training tool that has been working fine for ~ a month and a half. In the past every time it failed with statuscode 429 'You exceeded the limit of 200 samples per min', it was because I didn't wait long enough between posts. Waiting 1-2 minutes between posts always fixed the problem. The number of samples has never caused an issue, I have successfully trained it with a single post request containing more than 200 samples many times, getting back a confirmation like '{ "sent" : true, "n" : 796 }'.

Everything was working as expected yesterday, but when I tried to use the tool this morning, every time I tried to train with > 200 samples at once I hit the rate limit error. Training with <= 200 samples works as it always has.

What is the App ID where you are experiencing this issue (if applicable)?

2045532785478006 (and many other apps that use this tool)

jaisrael1 avatar Sep 19 '18 19:09 jaisrael1

Hey @jaisrael1 , we changed our rate limiting today to be more strict, and not allow requests that exceed the limit. We've recently had our systems go down multiple times due to thousands and thousands of samples being posted by some users. It would lead to confusion because a user would post a huge amount of samples, then the samples would never get to their app since the samples queue would get blocked. This is a bad experience for not only the user who sent a ton of samples, but everyone else who sends samples at the same time who are also blocked. We figured that introducing a stricter rate limit would make sure our systems are more operational, thereby ensuring that when you do post samples, they will be applied to your app.

You're right in that the error message isn't accurate, as you haven't actually exceeded the limit, I'll go ahead and fix that message.

Thanks for your patience, if your use case really requires exceeding the rate limit feel free to contact us at [email protected] for more specific discussion.

jtliao avatar Sep 19 '18 19:09 jtliao

So to clarify, you are changing the behavior so that no more than 200 samples can be included in a single POST /samples request?

jaisrael1 avatar Sep 19 '18 19:09 jaisrael1

For now, yes-- we'll look to see how many are affected by this and it can be adjusted in the future based on feedback.

jtliao avatar Sep 19 '18 20:09 jtliao

Will I still be able to post large bodies of training data in chunks? Say I execute 5 POST /samples requests in parallel each containing 200 samples, would that exceed the real rate limit?

jaisrael1 avatar Sep 19 '18 20:09 jaisrael1

It would have to be split up over time-- we don't treat 1 big request vs many smaller requests differently if executed at the same time, so it would exceed the limit.

jtliao avatar Sep 19 '18 20:09 jtliao