-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect restore rates for Orders API #101
Comments
I would appreciate someone else testing it on other Amazon accounts as well to double-check. But for now, I created a pull request with restore rates that I calculated after testing on different accounts. |
thanks for sharing your test results here. We have checked this with some accounts of different order amounts as well (ranging from a few per month to accounts with high 5 figures per month). What we can confirm is basically your points 1, 3, 4 and 5 and we also never received the However what we can't really confirm is the 5 second restore rate. As you stated in your point 3 is that restoring doesn't seem to be very evenly distributed which is what we also noticed. Sometimes not even 20 seconds between two requests is enough to prevent throttling, sometimes 2 seconds are fine. To us its not clear why the API behaves like this. We have already discussed this here previously (see #78), but didn't really come to a conclusion. Anyway, at least for the accounts we tested setting the restore rate to 5 seconds does result in quite a lot of throttling. But even if 5 seconds would always work fine we would still want to stay with the "documentation"-limit of 180 seconds. Setting it to something that's not in the docs might end up in having a lot of confusion, especially if this is the case in more parts of the module. Users still have the opportunity of setting |
For anyone looking for a workaround, you can specify your own
The key here is to manually specify an A 180-second delay for orderItems is completely unworkable in practice. With the MWS API, the rate limit for the equivalent operation is 1800 per hour (1 every 2 seconds). While I understand the need to default to the "official" rate limit stated in the documentation, I believe a happy compromise would be to let the user specify the @amz-tools - if you're happy with this approach, I can submit a PR for this. |
would absolutely support it. This would enable a simple workaround for the issue without having to directly change the official restore rate. |
@vhle-ms thanks for the workaround. Let me know if you need any help with the PR, I will for sure use the feature. |
Selling Partner API for Orders
I spent a lot of time testing restore rates for Orders API and I want to share what I found out.
In the documentation, it says the restore rate is 0.0055 which means one request every 180 seconds. Very soon I realized that this is not the case, it would take forever to load accounts with tens of thousands of orders.
I tested restore rates with getOrders (requesting 50 orders at a time) on 3 different accounts: 150, 500 and 12.000 orders/month.
Conclusions after testing:
The size of the account doesn’t affect the restore rate.
If you don’t want to have throttled requests:
You need to have 5 seconds delay between each request.
If you don’t care about extra traffic from throttled requests:
Amount of orders requested doesn’t affect restore rate
Restore rates from different operations (getOrders, getOrder, getOrderBuyerInfo, etc) are different. This means you can run them in parallel and they will not affect each other.
By default, this library waits 180 seconds for Orders API when throttled and Amazon never returns the header
x-amzn-ratelimit-limit
it means that on every throttled request it will wait 180 seconds.I will create a pull request with the “correct” restore rate. If someone wants more testing data - let me know, I tried to keep the post as concise as possible.
The text was updated successfully, but these errors were encountered: