Replies: 1 comment
-
Typically you'll create a job for each call so you can run many Sidekiq processes and process dozens/hundreds/thousands of jobs concurrently, depending on your rate limit. I don't know if you are a customer but you can use Pro's Batches to coordinate and Enterprise's Rate Limiting to not overwhelm the remote side and avoid HTTP 429 errors. If you want to get a little more complex, you can have each job handle a handful of calls and use a concurrent HTTP client to make those 5-10 calls in parallel. The issue is that error handling becomes a lot more complex because now you need to track which requests succeeded and which did not whereas one call per job needs no special tracking at all. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a scenario where we need to do a lot of slow http requests (to openAI). It is not an issue of one logical job having lots of requests, but that each job spends most of its time in a single web request.
Is there a recommendation on how to structure that with Sidekiq? Ex. Cranking the thread count, some setting to use fibers, etc?
Beta Was this translation helpful? Give feedback.
All reactions