moby--moby/daemon
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
..
caps Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
cluster Merge pull request #30633 from vdemeester/29809-fix-network-ipam-configuration-on-master 2017-02-01 17:53:49 +01:00
events modify some files 2016-12-22 08:38:37 +08:00
exec Move `StreamConfig` out of `runconfig` 2016-11-14 15:15:09 -05:00
graphdriver Merge pull request #29835 from yongtang/29810-btrfs-rescan 2017-01-26 15:55:51 -08:00
initlayer Implement content addressability for plugins 2016-12-23 13:29:58 -08:00
links check typos and fix in daemon directory 2016-11-26 17:23:21 +08:00
logger Implement optional ring buffer for container logs 2017-02-01 13:52:37 -05:00
network Fix autostart for swarm scope connected containers 2016-09-13 14:21:58 -07:00
stats Extract daemon statsCollector to its own package 2017-01-04 18:18:30 +01:00
apparmor_default.go daemon: switch to 'ensure' workflow for AppArmor profiles 2016-12-07 08:47:28 +11:00
apparmor_default_unsupported.go daemon: switch to 'ensure' workflow for AppArmor profiles 2016-12-07 08:47:28 +11:00
archive.go Fix uneccessary calls to `volume.Unmount()` 2016-11-10 14:04:08 -05:00
archive_unix.go Windows: docker cp consistent paths 2016-05-06 16:08:53 -07:00
archive_windows.go Windows: Remove TP4 support from main code 2016-04-06 12:12:20 -07:00
attach.go Resolve race conditions in attach API call 2017-02-01 09:01:36 +00:00
auth.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
bindmount_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
bindmount_unix.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
cache.go Extract the daemon image cache to its own package 2017-01-03 19:19:27 +01:00
changes.go Windows: support docker diff 2016-10-28 11:06:54 -07:00
checkpoint.go Move names to package api 2016-12-21 22:42:47 +01:00
cluster.go add `docker network prune` 2016-10-25 06:43:54 +00:00
commit.go commit: do not change container labels on commit 2016-12-19 09:56:20 -08:00
config.go Merge pull request #28631 from likel/master 2016-12-30 01:13:12 +01:00
config_common_unix.go Clean some stuff from runconfig that are cli only… 2016-12-24 13:16:00 +01:00
config_experimental.go Make experimental a runtime flag 2016-10-24 15:20:01 -07:00
config_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
config_test.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
config_unix.go Add daemon option --default-shm-size 2017-01-27 12:17:06 -08:00
config_unix_test.go Add daemon option --default-shm-size 2017-01-27 12:17:06 -08:00
config_windows.go Update docker daemon to dockerd 2016-12-27 17:32:15 +08:00
config_windows_test.go fix config load error with ulimits 2016-10-17 18:48:40 +08:00
container.go daemon: remove graphdb usage 2017-01-17 13:52:48 +00:00
container_linux.go Added an apparmorEnabled boolean in the Daemon struct to indicate if AppArmor is enabled or not. It is set in NewDaemon using sysInfo information. 2017-01-30 16:23:23 +01:00
container_operations.go Merge pull request #30117 from msabansal/natfix 2017-01-31 11:05:29 +01:00
container_operations_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
container_operations_unix.go Add daemon option --default-shm-size 2017-01-27 12:17:06 -08:00
container_operations_windows.go Windows: Factor out unused fields in container 2016-10-13 14:51:10 -07:00
container_windows.go Added an apparmorEnabled boolean in the Daemon struct to indicate if AppArmor is enabled or not. It is set in NewDaemon using sysInfo information. 2017-01-30 16:23:23 +01:00
create.go Fix issue for `--hostname` when running in "--net=host" 2016-12-06 07:29:45 -08:00
create_unix.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
create_windows.go Windows: Revert 27884 2016-11-16 13:38:45 -08:00
daemon.go Added an apparmorEnabled boolean in the Daemon struct to indicate if AppArmor is enabled or not. It is set in NewDaemon using sysInfo information. 2017-01-30 16:23:23 +01:00
daemon_experimental.go move plugins out of experimental 2016-11-10 15:51:32 -08:00
daemon_linux.go Fix container mount cleanup issues 2016-03-30 17:25:49 -07:00
daemon_linux_test.go Fix container mount cleanup issues 2016-03-30 17:25:49 -07:00
daemon_solaris.go fix nits in comments 2016-12-27 23:30:50 +08:00
daemon_test.go support registry mirror config reload 2017-01-04 11:04:00 +08:00
daemon_unix.go Merge pull request #29692 from yongtang/29492-daemon-shm-size 2017-02-01 16:56:10 +01:00
daemon_unix_test.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
daemon_unsupported.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
daemon_windows.go Added support for dns-search and fixes #30102 2017-01-13 12:01:10 -08:00
debugtrap.go Reduce spew data dumped 2016-11-17 13:10:48 -05:00
debugtrap_unix.go Spew debugging 2016-11-03 10:05:11 -07:00
debugtrap_unsupported.go Spew debugging 2016-11-03 10:05:11 -07:00
debugtrap_windows.go Spew debugging 2016-11-03 10:05:11 -07:00
delete.go Extract daemon statsCollector to its own package 2017-01-04 18:18:30 +01:00
delete_test.go make client side know container removal in progress 2016-09-27 18:06:54 +08:00
discovery.go validate heartbeat in discovery cluster opts 2016-09-01 01:07:05 +08:00
discovery_test.go validate heartbeat in discovery cluster opts 2016-09-01 01:07:05 +08:00
disk_usage.go *: use opencontainers/go-digest package 2017-01-06 18:48:41 -08:00
errors.go Move errors/ to api/errors 2016-09-16 12:27:13 -04:00
events.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
events_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
exec.go Resolve race conditions in attach API call 2017-02-01 09:01:36 +00:00
exec_linux.go Remove hacked Windows OCI spec, compile fixups 2016-09-27 12:07:35 -07:00
exec_solaris.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
exec_windows.go Windows: Plumb through user 2016-11-08 17:41:56 -08:00
export.go pkg/archive: remove unnecessary Archive and Reader type 2016-10-20 19:31:24 -07:00
getsize_unix.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
health.go Merge pull request #28438 from vdemeester/use-container-shell-instead-of-hardcoded 2016-11-18 18:54:36 -08:00
health_test.go Enhance pkg/{httputils,integration}, distribution/xfer unit tests 2016-12-28 11:54:05 +01:00
image.go Deprecate repo:shortid syntax 2016-10-06 17:12:17 -07:00
image_delete.go Generate ImageDeleteResponse from swagger spec. 2017-01-03 11:47:47 -05:00
image_exporter.go Move some image related methods & struct to smaller files 2016-05-21 22:36:11 +02:00
image_history.go Generate ImageHistory from swagger spec. 2017-01-03 11:47:44 -05:00
image_inspect.go Improve the error print of image inspect 2017-01-24 11:07:20 +08:00
image_pull.go *: use opencontainers/go-digest package 2017-01-06 18:48:41 -08:00
image_push.go Implement content addressability for plugins 2016-12-23 13:29:58 -08:00
image_tag.go Generalize content addressable and reference storage 2016-09-15 18:08:19 -07:00
images.go Ensure proper value is used when computing reclaimable space 2017-01-23 13:57:20 -08:00
import.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
info.go Move debug functions to cli/debug package 2016-12-12 09:33:58 +01:00
info_unix.go api: types: keep info.SecurityOptions a string slice 2016-11-19 13:21:16 +01:00
info_windows.go api: types: keep info.SecurityOptions a string slice 2016-11-19 13:21:16 +01:00
inspect.go record pid of exec'd process 2016-10-20 17:06:11 +02:00
inspect_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
inspect_unix.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
inspect_windows.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
keys.go Change root_maxkeys 2016-06-27 10:23:37 -07:00
keys_unsupported.go change minor mistake of spelling 2016-12-20 21:05:19 +08:00
kill.go fix nits in comments 2016-12-27 23:30:50 +08:00
links.go Windows: Factor out sqlite 2016-12-01 09:38:08 -08:00
list.go Add `publish` and `expose` filter for `docker ps --filter` 2017-01-27 13:25:32 -08:00
list_unix.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
list_windows.go
logdrivers_linux.go added logentries driver 2016-10-06 22:48:53 -03:00
logdrivers_windows.go Windows: Enable fluentd logdriver 2016-11-08 19:54:57 -08:00
logs.go Close logwatcher on context cancellation 2017-01-17 14:36:13 -08:00
logs_test.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
metrics.go Add basic prometheus support 2016-10-27 10:34:38 -07:00
monitor.go Move `StreamConfig` out of `runconfig` 2016-11-14 15:15:09 -05:00
monitor_linux.go Adding postRunProcessing infrastructure for hanlding Windows Update. 2016-04-06 14:03:05 -07:00
monitor_solaris.go Get the Docker Engine to build clean on Solaris 2016-05-23 16:37:12 -07:00
monitor_windows.go Move stdio attach from libcontainerd backend to callback 2016-10-24 00:20:36 -07:00
mounts.go Add new `HostConfig` field, `Mounts`. 2016-09-13 09:55:35 -04:00
names.go Use quoted form of container name and container id 2017-01-17 08:26:05 +00:00
network.go Remove attachable network on swarm leave 2017-01-26 11:16:07 -08:00
oci_linux.go Allow adding rules to cgroup devices.allow on container create/run 2017-01-26 07:20:45 -08:00
oci_solaris.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
oci_windows.go Refactoring ineffectual assignments 2017-01-13 00:27:01 -07:00
pause.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
prune.go Merge pull request #28409 from dnephin/swagger-gen-more 2017-01-26 10:35:34 -08:00
rename.go Fix rename error when sid is empty 2017-01-11 21:35:59 +08:00
resize.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
restart.go Allow providing a custom storage directory for docker checkpoints 2016-10-28 07:56:05 -04:00
search.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
search_test.go Remove redundant format 2016-12-27 21:46:52 +08:00
seccomp_disabled.go Replace old oci specs import with runtime-specs 2016-08-17 09:38:34 -07:00
seccomp_linux.go daemon: add a flag to override the default seccomp profile 2016-11-02 21:41:29 +01:00
seccomp_unsupported.go Fix seccomp output in `docker info` 2016-07-08 17:26:42 -07:00
secrets.go do not force target type for secret references 2016-11-17 15:49:02 -05:00
secrets_linux.go secrets: secret management for swarm 2016-11-09 14:27:43 -05:00
secrets_unsupported.go secrets: secret management for swarm 2016-11-09 14:27:43 -05:00
selinux_linux.go
selinux_unsupported.go
start.go Added an apparmorEnabled boolean in the Daemon struct to indicate if AppArmor is enabled or not. It is set in NewDaemon using sysInfo information. 2017-01-30 16:23:23 +01:00
start_unix.go daemon: honor default runtime when starting containers 2017-01-12 20:36:22 +01:00
start_windows.go Added support for dns-search and fixes #30102 2017-01-13 12:01:10 -08:00
stats.go Extract daemon statsCollector to its own package 2017-01-04 18:18:30 +01:00
stats_collector.go Extract daemon statsCollector to its own package 2017-01-04 18:18:30 +01:00
stats_unix.go Removed engine-api leftovers 2016-09-21 12:36:52 +02:00
stats_windows.go Windows: stats support 2016-09-16 11:56:15 -07:00
stop.go fix nits in comments 2016-12-27 23:30:50 +08:00
top_unix.go Convert ContainerTopOKResponse from swagger spec. 2017-01-03 11:47:47 -05:00
top_unix_test.go Validate arguments for `ps` in `docker top` 2016-07-08 05:58:11 +00:00
top_windows.go Convert ContainerTopOKResponse from swagger spec. 2017-01-03 11:47:47 -05:00
unpause.go remove running judgement when unpause container 2016-08-29 10:16:18 +08:00
update.go Fix update clear the restart policy of monitor 2016-12-16 20:57:05 -05:00
update_linux.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
update_solaris.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
update_windows.go Add engine-api types to docker 2016-09-07 11:05:58 -07:00
volumes.go Rename Remote API to Engine API 2016-11-22 12:49:38 +00:00
volumes_unit_test.go
volumes_unix.go close the file 2016-11-21 19:56:01 +08:00
volumes_windows.go Remove hacked Windows OCI spec, compile fixups 2016-09-27 12:07:35 -07:00
wait.go Fix race on force deleting container created by task 2016-06-14 16:49:04 -07:00
workdir.go COPY file . after WORKDIR (now always created) 2016-11-23 09:56:02 -08:00