René's URL Explorer Experiment


Title: perf(trigger): cap concurrency on background DB tasks by TheodoreSpeaks · Pull Request #5231 · simstudioai/sim · GitHub

Open Graph Title: perf(trigger): cap concurrency on background DB tasks by TheodoreSpeaks · Pull Request #5231 · simstudioai/sim

X Title: perf(trigger): cap concurrency on background DB tasks by TheodoreSpeaks · Pull Request #5231 · simstudioai/sim

Description: Summary Cap per-task Trigger.dev concurrency on the heavy DB-bound background tasks to mitigate the Postgres pool-exhaustion incident — unbounded fan-out spawned many machines that collectively saturated the pool. New apps/sim/background/concurrency-limits.ts defines env-overridable caps via the existing envNumber pattern: workflow-execution 75 (WORKFLOW_EXECUTION_CONCURRENCY_LIMIT), webhook-execution 75 (WEBHOOK_EXECUTION_CONCURRENCY_LIMIT), resume-execution 50 (RESUME_EXECUTION_CONCURRENCY_LIMIT). Lower the schedule cap default 50 → 30 (SCHEDULE_EXECUTION_CONCURRENCY_LIMIT). Register the three new env vars in env.ts. This is a strict reduction in peak concurrency — the three tasks were previously unbounded. Validated against 30d of prod run data workflow/webhook/resume caps sit well above real load (typical distinct concurrency ~2–25, max ~11 workflow runs/min, ~261 webhook runs/min in worst burst). schedule at 30 intentionally bites cron-boundary bursts (p95 ~30, p99 ~64 runs/min). Schedule already queues at 50; 30 adds some latency at peak by design. Note SCHEDULE_WORKFLOW_ENQUEUE_LIMIT = LIMIT × 2 drops 100→60 in tandem. Type of Change Performance / reliability Testing Tested manually — bun run lint (biome) clean, bun run check:api-validation:strict passes, tsc --noEmit clean on changed files. No API boundaries touched. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Cap per-task Trigger.dev concurrency on the heavy DB-bound background tasks to mitigate the Postgres pool-exhaustion incident — unbounded fan-out spawned many machines that collectively sa...

X Description: Summary Cap per-task Trigger.dev concurrency on the heavy DB-bound background tasks to mitigate the Postgres pool-exhaustion incident — unbounded fan-out spawned many machines that collectively sa...

Opengraph URL: https://github.com/simstudioai/sim/pull/5231

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c8b00e2c-2137-0427-8fed-678e1cc08fe2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE834:C876F:1217A5D:18E047D:6AFB6F39
html-safe-nonce7c5d3f5492b22a418b98645283cf5e16ec182921818df8c015be0890e6b39568
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODM0OkM4NzZGOjEyMTdBNUQ6MThFMDQ3RDo2QUZCNkYzOSIsInZpc2l0b3JfaWQiOiIxNzU2NDE1MDE0Nzk0MzkxMzUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2c67d9eab162b56003faa7d4cc1d10ba8bf6f2e290a9cc53e0afbe2c7eca8c95
hovercard-subject-tagpull_request:3945868538
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5231/files
twitter:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
og:image:altSummary Cap per-task Trigger.dev concurrency on the heavy DB-bound background tasks to mitigate the Postgres pool-exhaustion incident — unbounded fan-out spawned many machines that collectively sa...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release88808b1fae5ab8a526a73e7ce5542a10eb9d6971
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5231/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5231%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5231%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5231/files
Reloadhttps://github.com/simstudioai/sim/pull/5231/files
Reloadhttps://github.com/simstudioai/sim/pull/5231/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
TheodoreSpeakshttps://github.com/TheodoreSpeaks
staginghttps://github.com/simstudioai/sim/tree/staging
perf/trigger-concurrency-capshttps://github.com/simstudioai/sim/tree/perf/trigger-concurrency-caps
Conversation 7 https://github.com/simstudioai/sim/pull/5231
Commits 2 https://github.com/simstudioai/sim/pull/5231/commits
Checks 15 https://github.com/simstudioai/sim/pull/5231/checks
Files changed https://github.com/simstudioai/sim/pull/5231/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5231/files
perf(trigger): cap concurrency on background DB tasks https://github.com/simstudioai/sim/pull/5231/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/5231/files
e38e947 perf(trigger): cap concurrency on background DB tasks TheodoreSpeaks Jun 27, 2026 https://github.com/simstudioai/sim/pull/5231/commits/e38e94742c6e2ae234a9d1c2259cf0db68250ac2
c223eef test(trigger): update schedule concurrency assertion to 30 TheodoreSpeaks Jun 27, 2026 https://github.com/simstudioai/sim/pull/5231/commits/c223eef203822f83b17ec11af4f4a48bcce31645
Clear filters https://github.com/simstudioai/sim/pull/5231/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5231/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5231/files
async-execution-correlation.test.ts https://github.com/simstudioai/sim/pull/5231/files#diff-95886392fc3a5c0b39d1e407dbf3670abf6d1e7b09aa516db64f3bbe9eaa4039
concurrency-limits.ts https://github.com/simstudioai/sim/pull/5231/files#diff-d4e285cf5e5ef847c7271136a33970946eec3d6deb79feb206a6b1c53717198f
resume-execution.ts https://github.com/simstudioai/sim/pull/5231/files#diff-16ae42b061a34f194edac1f14848b4f357d4df95cf8e7fef2219a992da1c6e7f
webhook-execution.ts https://github.com/simstudioai/sim/pull/5231/files#diff-d3c199a17069fce702da388ec4cd1b4efc793e0a5968072a181280db5aafdbb1
workflow-execution.ts https://github.com/simstudioai/sim/pull/5231/files#diff-f8d70a9414b6740f6d7f47310a28af20aa45bcbfe00c399166f3f785dfc3903d
env.ts https://github.com/simstudioai/sim/pull/5231/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
execution-limits.ts https://github.com/simstudioai/sim/pull/5231/files#diff-b13b7ee204b01e1afaded96c5299ac409d98fa7742a594635741ad2ec61205d8
apps/sim/background/async-execution-correlation.test.tshttps://github.com/simstudioai/sim/pull/5231/files#diff-95886392fc3a5c0b39d1e407dbf3670abf6d1e7b09aa516db64f3bbe9eaa4039
View file https://github.com/simstudioai/sim/blob/c223eef203822f83b17ec11af4f4a48bcce31645/apps/sim/background/async-execution-correlation.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5231/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5231/files#diff-95886392fc3a5c0b39d1e407dbf3670abf6d1e7b09aa516db64f3bbe9eaa4039
https://github.com/simstudioai/sim/pull/5231/files#diff-95886392fc3a5c0b39d1e407dbf3670abf6d1e7b09aa516db64f3bbe9eaa4039
apps/sim/background/concurrency-limits.tshttps://github.com/simstudioai/sim/pull/5231/files#diff-d4e285cf5e5ef847c7271136a33970946eec3d6deb79feb206a6b1c53717198f
View file https://github.com/simstudioai/sim/blob/c223eef203822f83b17ec11af4f4a48bcce31645/apps/sim/background/concurrency-limits.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5231/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/5231/files
apps/sim/background/resume-execution.tshttps://github.com/simstudioai/sim/pull/5231/files#diff-16ae42b061a34f194edac1f14848b4f357d4df95cf8e7fef2219a992da1c6e7f
View file https://github.com/simstudioai/sim/blob/c223eef203822f83b17ec11af4f4a48bcce31645/apps/sim/background/resume-execution.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5231/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5231/files#diff-16ae42b061a34f194edac1f14848b4f357d4df95cf8e7fef2219a992da1c6e7f
https://github.com/simstudioai/sim/pull/5231/files#diff-16ae42b061a34f194edac1f14848b4f357d4df95cf8e7fef2219a992da1c6e7f
https://github.com/simstudioai/sim/pull/5231/files#diff-16ae42b061a34f194edac1f14848b4f357d4df95cf8e7fef2219a992da1c6e7f
apps/sim/background/webhook-execution.tshttps://github.com/simstudioai/sim/pull/5231/files#diff-d3c199a17069fce702da388ec4cd1b4efc793e0a5968072a181280db5aafdbb1
View file https://github.com/simstudioai/sim/blob/c223eef203822f83b17ec11af4f4a48bcce31645/apps/sim/background/webhook-execution.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5231/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5231/files#diff-d3c199a17069fce702da388ec4cd1b4efc793e0a5968072a181280db5aafdbb1
https://github.com/simstudioai/sim/pull/5231/files#diff-d3c199a17069fce702da388ec4cd1b4efc793e0a5968072a181280db5aafdbb1
https://github.com/simstudioai/sim/pull/5231/files#diff-d3c199a17069fce702da388ec4cd1b4efc793e0a5968072a181280db5aafdbb1
apps/sim/background/workflow-execution.tshttps://github.com/simstudioai/sim/pull/5231/files#diff-f8d70a9414b6740f6d7f47310a28af20aa45bcbfe00c399166f3f785dfc3903d
View file https://github.com/simstudioai/sim/blob/c223eef203822f83b17ec11af4f4a48bcce31645/apps/sim/background/workflow-execution.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5231/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5231/files#diff-f8d70a9414b6740f6d7f47310a28af20aa45bcbfe00c399166f3f785dfc3903d
https://github.com/simstudioai/sim/pull/5231/files#diff-f8d70a9414b6740f6d7f47310a28af20aa45bcbfe00c399166f3f785dfc3903d
https://github.com/simstudioai/sim/pull/5231/files#diff-f8d70a9414b6740f6d7f47310a28af20aa45bcbfe00c399166f3f785dfc3903d
Please reload this pagehttps://github.com/simstudioai/sim/pull/5231/files
apps/sim/lib/core/config/env.tshttps://github.com/simstudioai/sim/pull/5231/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
View file https://github.com/simstudioai/sim/blob/c223eef203822f83b17ec11af4f4a48bcce31645/apps/sim/lib/core/config/env.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5231/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5231/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
https://github.com/simstudioai/sim/pull/5231/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
apps/sim/lib/workflows/schedules/execution-limits.tshttps://github.com/simstudioai/sim/pull/5231/files#diff-b13b7ee204b01e1afaded96c5299ac409d98fa7742a594635741ad2ec61205d8
View file https://github.com/simstudioai/sim/blob/c223eef203822f83b17ec11af4f4a48bcce31645/apps/sim/lib/workflows/schedules/execution-limits.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5231/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5231/files#diff-b13b7ee204b01e1afaded96c5299ac409d98fa7742a594635741ad2ec61205d8
https://github.com/simstudioai/sim/pull/5231/files#diff-b13b7ee204b01e1afaded96c5299ac409d98fa7742a594635741ad2ec61205d8
Please reload this pagehttps://github.com/simstudioai/sim/pull/5231/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.