Removing the (huge) logging overhead for Docker

When using the Docker driver, the way Nomad catpures task’s log brings quite a crazy memory overhead : for each container, Nomad spawns one docker_logger and one logmon, each of them consuming somewhere between 50 and 60MB of RAM). When using a lot of small containers as sidecars, this overhead is just insane (on my nodes, it represented between 20 and 30% of the total memory !)

I removed this overhead by using a local vector agent on my nodes. This agent receive log streams directly from the Docker daemon (using the fluent protocol), and then recreate the log files, just how Nomad would have done. This way, you can still consult logs from the Nomad interface or API. Here’s how I’ve done : Suppress Nomad's loggi... | BookStack

Maybe it can be usefull to others :wink:

2 Likes