https://github.com/heyman/http-warmup
Python script & Docker image that waits for an HTTP server to come online and optionally warms it up with a specified number of requests
https://github.com/heyman/http-warmup
devops docker http
Last synced: 10 months ago
JSON representation
Python script & Docker image that waits for an HTTP server to come online and optionally warms it up with a specified number of requests
- Host: GitHub
- URL: https://github.com/heyman/http-warmup
- Owner: heyman
- Created: 2022-05-25T13:38:03.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T18:51:50.000Z (almost 4 years ago)
- Last Synced: 2025-05-15T18:47:20.661Z (11 months ago)
- Topics: devops, docker, http
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# http-warmup
Python script / Docker image that waits for an HTTP server to come online and optionally
warms it up by sending some requests to it.
This can be used to warm up a web server before starting to redirect real HTTP requests from
users, when doing zero downtime deployments.
## Usage
**Wait for a host to reply with an HTTP 2xx response:**
```
docker run --rm -it heyman/http-warmup https://example.org
```
**Send 20 warm-up requests using three threads once the server has come alive:**
```
docker run --rm -it heyman/http-warmup --warmup-requests=20 --warmup-threads=3 https://example.org
```
**Set the max time that we should wait for the server to come alive to 5 minutes**:
```
docker run --rm -it heyman/http-warmup --timeout=300 https://example.org
```
## Options
```
Usage: warmup.py [OPTIONS] URLS...
At least one URL must be specified. The first URL is pinged until it returns
a 2xx HTTP response.
If --warmup-requests is used the URLs will be round robin picked from all
specified URLS
Options:
--timeout INTEGER Number of seconds to wait for the host to come
online. Default: 60
--warmup-requests INTEGER Number of warm-up requests to send. Default: 0
--warmup-threads INTEGER Number of threads used to send the warm-up
requests. Default: 1
--request-timeout INTEGER Request timeout for individual HTTP requests.
Default: 5
--hostname TEXT Overrides the `Hostname` HTTP request header if
specified
-v, --verbose
--help Show this message and exit.
```