Skip to content

Commit 5c2b43d

Browse files
committed
docs: ✏️ FAQ.md
1 parent 06257c8 commit 5c2b43d

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

FAQ.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Frequently Asked Questions
2+
3+
## Gunicorn Worker keep restarting when starting server (`WORKER TIMEOUT`)
4+
```shell
5+
[2025-04-01 14:54:24 +0800] [15231] [INFO] Starting gunicorn 20.1.0
6+
[2025-04-01 14:54:24 +0800] [15231] [INFO] Listening at: http://0.0.0.0:8000 (15231)
7+
[2025-04-01 14:54:24 +0800] [15231] [INFO] Using worker: gevent
8+
[2025-04-01 14:54:24 +0800] [15233] [INFO] Booting worker with pid: 15233
9+
[2025-04-01 14:54:55 +0800] [15231] [CRITICAL] WORKER TIMEOUT (pid:15233)
10+
INFO 2025-04-01 14:54:55: Worker exiting (pid: 15233)
11+
[2025-04-01 14:54:55 +0800] [15409] [INFO] Booting worker with pid: 15409
12+
```
13+
14+
Code decryption may increases application startup time, which may cause the worker to exceed the default timeout threshold (30 seconds), leading to `WORKER TIMEOUT` errors.
15+
16+
To resolve this, increase Gunicorn’s [--timeout](https://docs.gunicorn.org/en/latest/settings.html#timeout) setting to factor in the additional decryption time.
17+
```shell
18+
# Set timeout to 60 seconds via command line:
19+
gunicorn --workers 4 --timeout 60 --worker-class gevent your_app:app
20+
21+
# Or configure via a config file (gunicorn.py):
22+
timeout = 60
23+
worker_class = "gevent"
24+
```

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ eval (env _PYENCRYPT_COMPLETE=fish_source pyencrypt)
204204
--before="2000-01-01T00:00:00 +0800" --after="2030-01-01T00:00:00 +0800"\
205205
--bind-mac="AC:DE:48:00:11:22" --bind-ipv4="192.168.0.1"
206206
```
207+
## FAQ
208+
209+
See [FAQ](FAQ.md) for frequently asked questions.
207210

208211
## Development
209212

0 commit comments

Comments
 (0)