k3s/cluster/addons/fluentd-elasticsearch/fluentd-es-image
Eduardo Silva 5e321af2ed cluser/addons: fluentd-elasticsearch: preload Jemalloc for td-agent
The current DockerFile build an image using td-agent package but it let
the service run with the default memory allocator provided by glibc.

In high load environments, is highly required to use a customized memory
allocator such as Jemalloc. Otherwise the service will face a high memory
fragmentation ending up in 'high memory' usage from a monitoring perspective.

td-agent package by default install Jemalloc and set the LD_PRELOAD
environment variable through it init script, but since the service is
launched through Docker the env variable needs to be set manually.

After this patch, when running td-agent container image now is possible
to see that Jemalloc is used:

  root@monotop:/proc/18810# cat maps |grep jemall
  7f251eddd000-7f251ee1b000 ... /opt/td-agent/embedded/lib/libjemalloc.so.2
  7f251ee1b000-7f251f01b000 ... /opt/td-agent/embedded/lib/libjemalloc.so.2
  7f251f01b000-7f251f01d000 ... /opt/td-agent/embedded/lib/libjemalloc.so.2
  7f251f01d000-7f251f01e000 ... /opt/td-agent/embedded/lib/libjemalloc.so.2

For a reference about the memory usage difference between malloc v/s jemalloc
please refer to the following chart:

  https://goo.gl/dVYTmw

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
2016-10-20 10:50:58 -06:00
..
Dockerfile cluser/addons: fluentd-elasticsearch: preload Jemalloc for td-agent 2016-10-20 10:50:58 -06:00
Makefile Update `gcloud docker` commands to use `gcloud docker -- ARGS` 2016-10-10 13:42:34 -07:00
README.md Fixing a simple typo 2016-03-06 23:49:35 -08:00
build.sh Remove kubernetes metadata plugin 2016-08-23 08:21:46 -03:00
td-agent.conf Remove kubernetes metadata plugin 2016-08-23 08:21:46 -03:00

README.md

Collecting Docker Log Files with Fluentd and Elasticsearch

This directory contains the source files needed to make a Docker image that collects Docker container log files using Fluentd and sends them to an instance of Elasticsearch. This image is designed to be used as part of the Kubernetes cluster bring up process. The image resides at DockerHub under the name kubernetes/fluentd-elasticsearch.

Analytics