Mukulch15

Mukulch15

Parallel job processing in Oban

I have created a queue in Oban with a concurrency of 12. The worker’s job is to take the parameters, make an http call and insert the response into database. However when I inserted jobs using Oban.insert_all, I see that the jobs are getting processed serially and not in parallel. Am I missing any config ? Or is it something provided in Oban pro.

Marked As Solved

sorentwo

sorentwo

Oban Core Team

Ah. This is because you’re running with inline test mode. That should only be enabled in test.exs, not for your base config.

The way you have it configured you’re never persisting anything into the database, it’s executing them one at a time in memory.

Also Liked

Mukulch15

Mukulch15

Thank you so much. It’s working now. It’s been more than a day. :sweat_smile:

outlog

outlog

is the http library running a queue of 1?

else show some pseudo code, and/or debug by removing http call and do something like this in the worker:

IO.inspect("job started")
:timer.sleep(5_000)
IO.inspect("job done")

and see if they are parallel..

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

If you have 12 workers, they should all try to process a job, which means you should see 12 jobs in progress at once (parallel).

Can you tell us how you are sure they’re happening serially?

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement