Simulates backoff strategies for contending writes over the network.
Project description
Backoff Simulator
Many clients request over the network that the server write a particular value. If writes contend, only one commits. Clients back off and retry until their write commits.
You want to keep low:
- the time until all writes commit (duration)
- the total number of requests (work)
You can keep the duration low by making clients retry rapidly. But then writes often contend, so the work is high.
You can keep the work low by making clients retry sporadically. But then the server is often idle, so the duration is high.
So there’s a tradeoff.
The cost is a combined measure of duration and work. It's set by a work-to-duration exchange rate: how much you weight work compared to duration.
There's a famous aws blog post and simulation script about this:
- https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter
- https://github.com/aws-samples/aws-arch-backoff-simulator
This simulation is based on those. But I re-implemented the simulation and added a few bells and whistles.
The blog post is clear:
The return on implementation complexity of using jittered backoff is huge, and it should be considered a standard approach for remote clients.
But is that true of your use case?
Let's explore.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file backoff_simulator-0.1.1.tar.gz.
File metadata
- Download URL: backoff_simulator-0.1.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe62ca0bc3ef5c50b9da9991cc7186c1aaee2adfb088a3b86e8cfd393680f806
|
|
| MD5 |
d57c7d5542e03de1b0733002a095a120
|
|
| BLAKE2b-256 |
a30136a084c0d4b2a1d104f0704bda57b6d5cf97c3b52e682b86a08dac20c634
|
File details
Details for the file backoff_simulator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: backoff_simulator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
638856858940f8020ed62f52b5ef2f3192d11d0e758bc5c3d34905df9fde97ac
|
|
| MD5 |
5e059c9a6951fdcdfefa83486f47314c
|
|
| BLAKE2b-256 |
7da05be55e0ca1613686b1ad5dc1542bc44457d9f1b937619d70d74b58cf7f8f
|