Shut down services gracefully
Prompt that defines a shutdown sequence so deployments do not abort requests or lose jobs. Paste it into an AI tool of your choice, which then defines the shutdown sequence.
- Topic
- Apps & prototypes
- Type
- Prompt
- Level
- Intermediate
- Time
- about 15 min
Results depend on the tool, the model and what you enter.
Result preview
Example: written by our editors, not real AI output.
Target sequence after SIGTERM: 0 s health check reports "not ready" 0–5 s load balancer removes the service 5–25 s finish running requests 25 s return open jobs to the queue 28 s close connections, process exits Platform deadline: 30 s (fits) Test: 200 requests/s, deployment, 0 aborted requests
Fill in
What you type stays in this browser window. We store and send nothing.
- web API
- queue worker
- service with long-lived connections
- scheduled batch job
- gateway or proxy
- container platform
- virtual machines behind a load balancer
- serverless functions
- own server
- not sure
- 502 errors for some users
- messages processed twice
- aborted uploads
- jobs left half done
- nothing visible but unsure
Your prompt
You have edited the prompt. Changes in the fields above no longer overwrite it.
This is an instruction for an AI, not the result itself.
Where this prompt works
These AI tools are a good fit for this prompt:
How to use it
- Fill in the fields or tap a suggestion. Leave out names, addresses and other personal data.
- Copy the finished prompt into an AI tool of your choice.
- Paste the startup code, the signal handling, the health check and shutdown deadline settings and a log excerpt from a deployment.
Why does this work?
Every deployment stops processes. Without a fixed sequence, each release hits a few users, and jobs quietly lose data.
Tips
- Test the sequence on a staging system under realistic load before you change deadlines in production.