#Concurrency Limits in Dev and Staging

1 messages · Page 1 of 1 (latest)

tepid heron
#

Hey all! Sorry if this is a bit of a n00b question. I was just wondering if concurrency is limited in staging and development? I currently have a task that should be concurrent up to 10 tasks at once, but when testing on development and staging these happen sequentially.

Here's a little peek at the code, thanks in advance!

export const createJobTask = schemaTask({
id: "create-job-task",
schema: createJobWithOrganisationAndAdaptedStatusSchema,
queue: {
concurrencyLimit: 10,
},
retry: {
maxAttempts: 3,
factor: 1.8,
minTimeoutInMs: 500,
maxTimeoutInMs: 30_000,
randomize: false,
},
//...

simple tulipBOT
#

Hi @tepid heron. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes, concurrency is limited in both development and staging environments in Trigger.dev.

Development Environment:
By default, the maximum number of concurrent runs in development is set to 25. You can adjust this limit using the DEV_MAX_CONCURRENT_RUNS environment variable if needed. This means that even if your task's queue is set to allow 10 concurrent runs, the overall dev environment will not allow more than the configured maximum concurrent runs at any time.
Reference:

DEV_MAX_CONCURRENT_RUNS | No | 25 | Sets the max concurrency for dev runs via the CLI.
Webapp Env Vars

Staging Environment:
The overall concurrency limit for staging (and production) is determined by your plan. For example, the Free plan allows 10 concurrent runs, Hobby allows 25, and Pro allows 100+. These are environment-wide limits, so if you have multiple tasks running, they all share this concurrency pool.
Reference:

Pricing tier Limit
Free 10 concurrent runs
Hobby 25 concurrent runs
Pro 100+ concurrent runs
Limits

Why your tasks may run sequentially:
If your environment's concurrency limit is lower than your task's queue concurrency limit, or if other tasks are also running, you may see tasks executing sequentially rather than concurrently. Make sure your environment's concurrency settings and your plan support the level of concurrency you want to test.

Summary:

  • In dev, check and possibly increase DEV_MAX_CONCURRENT_RUNS.
  • In staging, your plan's concurrency limit applies.
  • Task-level concurrency cannot exceed environment-level concurrency.
#

If you need higher concurrency for testing, adjust your environment variables or consider upgrading your plan.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@tepid heron Kapa.ai is still learning and improving, please let me know how I did by reacting below.

regal igloo
#

Hey @tepid heron,

They are limited based on your plan. If you go to the "Queues" page in the sidebar you can see your limits and click through to see the runs that are Queued and Running

#

Let me know if you have any other questions