1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/container
Brian Goff 054abff3b6 Implement optional ring buffer for container logs
This allows the user to set a logging mode to "blocking" (default), or
"non-blocking", which uses the ring buffer as a proxy to the real log
driver.

This allows a container to never be blocked on stdio at the cost of
dropping log messages.

Introduces 2 new log-opts that works for all drivers, `log-mode` and
`log-size`. `log-mode` takes a  value of "blocking", or "non-blocking"
I chose not to implement this as a bool since it is difficult to
determine if the mode was set to false vs just not set... especially
difficult when merging the default daemon config with the container config.
`log-size` takes a size string, e.g. `2MB`, which sets the max size
of the ring buffer. When the max size is reached, it will start
dropping log messages.

```
BenchmarkRingLoggerThroughputNoReceiver-8           	2000000000	        36.2 ns/op	 856.35 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputWithReceiverDelay0-8   	300000000	       156 ns/op	 198.48 MB/s	      32 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay1-8        	2000000000	        36.1 ns/op	 857.80 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay10-8       	1000000000	        36.2 ns/op	 856.53 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay50-8       	2000000000	        34.7 ns/op	 894.65 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay100-8      	2000000000	        35.1 ns/op	 883.91 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay300-8      	1000000000	        35.9 ns/op	 863.90 MB/s	       0 B/op	       0 allocs/op
BenchmarkRingLoggerThroughputConsumeDelay500-8      	2000000000	        35.8 ns/op	 866.88 MB/s	       0 B/op	       0 allocs/op
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-01 13:52:37 -05:00
..
stream Resolve race conditions in attach API call 2017-02-01 09:01:36 +00:00
archive.go
container.go Implement optional ring buffer for container logs 2017-02-01 13:52:37 -05:00
container_linux.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
container_notlinux.go add SecretMount and UnmountSecrets methods for non-Linux 2016-11-09 14:27:43 -05:00
container_unit_test.go
container_unix.go Add daemon option --default-shm-size 2017-01-27 12:17:06 -08:00
container_windows.go Move ReplaceOrAppendEnvValues to container package 2016-12-21 22:42:39 +01:00
env.go Move ReplaceOrAppendEnvValues to container package 2016-12-21 22:42:39 +01:00
env_test.go Move ReplaceOrAppendEnvValues to container package 2016-12-21 22:42:39 +01:00
health.go Fix deadlock on cancelling healthcheck 2016-11-15 20:10:16 -08:00
history.go
memory_store.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
memory_store_test.go Fix some output information for container test 2016-11-24 20:01:00 +08:00
monitor.go Move StreamConfig out of runconfig 2016-11-14 15:15:09 -05:00
mounts_unix.go
mounts_windows.go
state.go Use WaitWithContext for WaitStop 2016-11-16 22:08:37 -05:00
state_solaris.go
state_test.go Fix some output information for container test 2016-11-24 20:01:00 +08:00
state_unix.go
state_windows.go
store.go