Skip to content

Commit 990a540

Browse files
authored
Update README.md
1 parent cdc62dc commit 990a540

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ docker run -d -p 80:8080 -e BJOERN_PORT=8080 myimage
112112

113113
##### `BJOERN_REUSEPORT`
114114

115-
Bjoern supports enabling SO_REUSEPORT if available on the system and has been enabled by default in this image. In short, if an application has terminated for whatever reason, the system may still hold onto the port while it's clearing the buffer out. This blocks other applications including new instances of the same application from binding to it during this time (which can be a lengthy process, in some cases up to 2 min). Setting this flag when binding to the port allows other applications to bind to the port during this timeout period. While there is the possibility that it could cause strange behavior, those are _extremely_ rare. Generally speaking, ther perception is that enabling this behavior is a good thing at least with regard to performance. However, it should be noted that since this image is not using any kind of supervisor to restart the application if it crashes (this is usually best left to the cluster controller to just let it replace the pod), this image probably does not truly make use of it.
115+
Bjoern supports enabling SO_REUSEPORT if it's available on the system (Python's base images use Debian which supports this). This has been enabled by default in this image. What does this do? In short, if an application has terminated for whatever reason (quit, killed, etc) the system may still hold onto the port while it's clearing the buffer out. This process blocks other applications including new instances of the same application from binding to the port during this time (which can be a lengthy process, in some cases up to 2 min). Setting this flag when binding to the port allows other applications to bind to the port during this timeout period. While there is the possibility that it could cause strange behavior, those are _extremely_ rare. Generally speaking, the perception is that enabling this behavior is a good thing at least with regard to performance. However, it should be noted that since this image is not using any kind of supervisor to restart the application if it crashes (I find this is usually best left to the cluster controller so it can just replace the pod), this image probably does not truly make use of it.
116116

117-
To disable this behavior, send any value that is _not_ the string of `"true"` to disable it.
117+
To disable this behavior, send any value that is _not_ the string of `"true"` using the `BJOERN_REUSEPORT` variable.
118118

119119
```bash
120120
docker run -d -p 80:80 -e BJOERN_REUSEPORT="false" myimage

0 commit comments

Comments
 (0)