1
0
mirror of https://github.com/docker/cli.git synced 2026-01-23 15:21:32 +03:00
Files
cli/components/engine/daemon
Brian Goff 11a6f80b8b 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>
Upstream-commit: 054abff3b67bb5d66323e5418a43c845a3eac8a1
Component: engine
2017-02-01 13:52:37 -05:00
..
2016-12-22 08:38:37 +08:00
2016-11-14 15:15:09 -05:00
2016-09-07 11:05:58 -07:00
2016-10-28 11:06:54 -07:00
2016-12-21 22:42:47 +01:00
2016-10-25 06:43:54 +00:00
2017-01-17 13:52:48 +00:00
2016-11-16 13:38:45 -08:00
2016-12-27 23:30:50 +08:00
2016-11-03 10:05:11 -07:00
2016-11-03 10:05:11 -07:00
2016-11-03 10:05:11 -07:00
2016-11-17 13:10:48 -05:00
2016-09-16 12:27:13 -04:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-11-08 17:41:56 -08:00
2016-10-06 17:12:17 -07:00
2016-09-07 11:05:58 -07:00
2016-10-20 17:06:11 +02:00
2016-06-27 10:23:37 -07:00
2016-12-27 23:30:50 +08:00
2016-12-01 09:38:08 -08:00
2016-10-06 22:48:53 -03:00
2016-09-07 11:05:58 -07:00
2016-10-27 10:34:38 -07:00
2016-11-14 15:15:09 -05:00
2016-09-13 09:55:35 -04:00
2017-01-11 21:35:59 +08:00
2016-12-27 21:46:52 +08:00
2016-09-07 11:05:58 -07:00
2016-09-21 12:36:52 +02:00
2016-09-16 11:56:15 -07:00
2016-12-27 23:30:50 +08:00
2016-09-07 11:05:58 -07:00
2016-11-21 19:56:01 +08:00
2016-11-22 12:49:38 +00:00