question

njsmith49423 avatar image
0 Likes"
njsmith49423 asked ·

Extremely slow API response

We have been running into an issue over the past few days where API calls have been intermittently running extremely slowly, and have often times been timing out before they can respond. This is both in PHP and .NET, so it doesn't appear to be an implementation issue on our end, and is occurring in code that has been in use unchanged for (in some cases) over a year. As just one example, I was seeing AddItem calls taking up to 60+ seconds to respond last night. We're looking into some workarounds to be less reliant on eBay's API during our pre-listing processing, but that's going to take some time to develop, and as this decided to happen while I was out of town on business, it's real hard to try and troubleshoot anything in real-time. So I guess I have two questions: 1. Are we the only ones experiencing this, or are others seeing the same issue? 2. Any idea how to get things running as normal again?
additemtrading-apiuploadsitehostedpictures
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
th3monk3y avatar image
0 Likes"
th3monk3y answered ·
Hi Njsmith, Are you using sandbox, live or both? You had mentioned some of the code in place for a year, so I'm assuming live in some cases. One thing that I have noticed is the initial request takes a long time until you are authenticated, then from there the api will work pretty fast. My work around has been to use multi-threading. 18 threads max if you want to stay within the Compatible Application Check restraints. Send your jobs up in batches. I can add 1 item or 100 items. It takes pretty much the same time. I haven't done actual benchmarks, but time it by stopwatch, so I'm close. In our .Net solution we use parallel tasking Once you have your ApiContext use tasking to batch a list of items. // Initialize eBay ApiContext object outside of loop ApiContext apiContext = new ApiContext(); apiContext.GetApiContext(id); <-- GetApiContext is an extension method we created Parallel.ForEach(Items, new ParallelOptions { MaxDegreeOfParallelism = 18 }, (item) => { // Do your work } Hope this helps...
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.