fix(renderer): raise the default render timeout to 30s

Under normal load on the shared host, a /wheelofnames GIF takes 11-12s
and a /gacha wish 14-15s to render, so the 15s default turned ordinary
renders into 504s. The default is now 30s, and the bot waits 45s so it
never abandons a render the renderer is still allowed to finish.
This commit is contained in:
tiennm99 committed 2026-10-03 13:06:04 +07:00
1 parent 1c64b44a46
commit c18006fabc
6 files changed
+10 -6

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ services:
# Set any of these in the Coolify dashboard; it reaches this service
# through Coolify's injected .env. Outside Coolify, uncomment a line.
# RENDERER_MAX_CONCURRENT_RENDERS: ${RENDERER_MAX_CONCURRENT_RENDERS:-1}
# RENDERER_RENDER_TIMEOUT_MS: ${RENDERER_RENDER_TIMEOUT_MS:-15000} # floor 7000
# RENDERER_RENDER_TIMEOUT_MS: ${RENDERER_RENDER_TIMEOUT_MS:-30000} # floor 7000
# RENDERER_MAX_OPTIONS: ${RENDERER_MAX_OPTIONS:-32} # wheel options
# RENDERER_MAX_OPTION_CHARS: ${RENDERER_MAX_OPTION_CHARS:-40} # chars per option/label
+5 -1
View File
@@ -24,7 +24,11 @@ const (
rendererURLEnv = "RENDERER_URL"
rendererMaxBytes = 12 << 20
rendererTimeout = 30 * time.Second
// rendererTimeout outlasts the renderer's own default render limit
// (RENDERER_RENDER_TIMEOUT_MS, 30s) plus upload time, so a slow render
// ends in the renderer's 504 rather than the bot abandoning a render
// that was about to finish.
rendererTimeout = 45 * time.Second
wheelRemoteDurationMs = 6000
wheelRemoteHoldMs = 1000
+1 -1
View File
@@ -3,6 +3,6 @@ RENDERER_HOST=0.0.0.0
NODE_ENV=production
RENDERER_MAX_CONCURRENT_RENDERS=1
# Remotion browser timeout floor is 7000ms; lower values are raised to 7000.
RENDERER_RENDER_TIMEOUT_MS=15000
RENDERER_RENDER_TIMEOUT_MS=30000
RENDERER_MAX_OPTIONS=32
RENDERER_MAX_OPTION_CHARS=40
+1 -1
View File
@@ -183,5 +183,5 @@ docker run --rm -p 3000:3000 miti99bot-renderer
Recommended starting resources: 1-2 vCPU and 1-2 GB RAM, with
`RENDERER_MAX_CONCURRENT_RENDERS=1`. `RENDERER_RENDER_TIMEOUT_MS` defaults to
`15000` and is raised to Remotion's `7000ms` browser timeout floor when configured lower.
`30000` and is raised to Remotion's `7000ms` browser timeout floor when configured lower.
The API has no authentication; publish its port only on a trusted network.
+1 -1
View File
@@ -34,7 +34,7 @@ Env vars, all optional (defaults shown):
RENDERER_PORT=3000
RENDERER_HOST=0.0.0.0
RENDERER_MAX_CONCURRENT_RENDERS=1
RENDERER_RENDER_TIMEOUT_MS=15000
RENDERER_RENDER_TIMEOUT_MS=30000
RENDERER_MAX_OPTIONS=32
RENDERER_MAX_OPTION_CHARS=40
```
+1 -1
View File
@@ -35,7 +35,7 @@ export const loadConfig = (env = process.env) => {
maxConcurrentRenders: parsePositiveInt(env.RENDERER_MAX_CONCURRENT_RENDERS, 1),
renderTimeoutMs: Math.max(
minRenderTimeoutMs,
parsePositiveInt(env.RENDERER_RENDER_TIMEOUT_MS, 15000),
parsePositiveInt(env.RENDERER_RENDER_TIMEOUT_MS, 30000),
),
maxOptions: parsePositiveInt(env.RENDERER_MAX_OPTIONS, 32),
maxOptionChars: parsePositiveInt(env.RENDERER_MAX_OPTION_CHARS, 40),