Repository navigation
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
A trial signup that gets a standby site waits for four short jobs: Add Domain and Update Site Configuration on the app server, and Add Domain to Upstream and Setup Redirects on Hosts on the proxy. Each runs in a second or two, but they shared the queues with New Site, Update Site Migrate and Install App, which take minutes. When long jobs held every worker, the signup waited minutes for a free one. Move these jobs to a new `signup` queue with a dedicated `worker_signup` supervisor program that listens only on that queue, so a long job can never hold it. The shared workers list `signup` first, so they also take signup jobs when free. The worker count comes from `signup_workers` in the agent config, defaulting to 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5b0302b to
c74c403
Compare
|
Press side of the same fix: frappe/press#7926. After these jobs finish, Press now reads them straight from the agent while the signup page is waiting, instead of waiting for the next poll. Ordering check. With this PR, a short job can start before a long job queued earlier for the same site. Before, a short job could already run alongside that long job, but it couldn't start first. I checked prod for 26–29 Oct: 35,376 of these short jobs, joined with long site jobs on the same site.
On the Press side, dashboard config changes require the site to be Active or Broken ( |
Problem
A trial signup that gets a standby (pool) site waits for four short agent jobs:
Add DomainandUpdate Site Configurationon the app serverAdd Domain to UpstreamandSetup Redirects on Hostson the proxyEach runs in 1–2 seconds. But they shared the
high/defaultqueues withNew Site,Update Site MigrateandInstall App, which take minutes. Pool refills and pool site updates often start several of those on one server at the same time. When they hold every worker, the signup job waits for one to free up.Over 7 days of pool signups, half of these jobs waited 2–4 s and 90% waited under 8 s. But 1% waited more than 80–90 s, and the longest waited about 5.5 minutes. In the cases checked, the signup job started within seconds of a long job ending on that server.
Change
signupqueue.worker_signupsupervisor program listens only onsignup. It never picks up a long job while idle, so a signup job never waits behind one. This is unlikeworker_backup, which also takes the shared queues.signup high default low. They also take signup jobs when free, so signups still run if the signup worker is down.signup_workersin the agent config, defaulting to 1.update_agent_webandupdate_agent_clistop, start and restart the new program likeworker_backup.The same four jobs also run outside signups (custom domains, config changes). They are all short: in the last day the busiest server got 13
Update Site Configurationjobs in one minute, and each finishes in under a second. So one worker clears a burst in seconds.These jobs take locks only for short config writes (the bench's
nginx.config.lock, the proxy's config lock), so a long job can't block them through a lock.Tests
TestServerSupervisorConfigrenders the supervisor config and checks:worker_signuplistens only onsignup.signup.worker_signupis in theagentgroup.🤖 Generated with Claude Code