Docker consuming more HD memory

I have a play application and running in docker 1.10.3. We are hitting this applicaton with 1000 request per second to do a load test. Application works fine. We see a significant HD memory consumed by Docker. In 3 day the docker consumed fron 2.2gb to 39gb. This worries us a load.

Docker INFO and the consumed space highlighted
enter image description here

  • docker swarm stop containers on quorum loss
  • How do I access a private maven repo from inside a docker container?
  • Run Hadoop with Docker (for both DEV and PROD environments)
  • subgit timeout waiting for pid file
  • Bridge docker container port to host port
  • Can't run Docker container from image after commit
  • Is there any was to configre docker not to consumen HD memory?
    Any help will be appreciated.

  • How to install memcached in docker container
  • symbol not found errors with glibc
  • Docker - Running Apache and Multiple JARs
  • java.lang.StackOverflowError in pio train phase
  • Setup secured Jenkins master with docker
  • error : curl: (52) Empty reply from server , when ingesting data into druid
  • One Solution collect form web for “Docker consuming more HD memory”

    Docker captures the standard output (STDOUT) of your application and stores it (by default) in an internal log file. You can find this file at /var/lib/docker/containers/$CONTAINER_ID/$CONTAINER_ID-json.log. This file is not rotated by default and may grow large if your application prints to STDOUT verbosely.

    Two possible solutions:

    1. Configure log rotation for the Docker log files. I’ve found a good article here that describes how to enable log rotation for Docker by creating the file /etc/logrotate.d/docker-container with the following contents:

      /var/lib/docker/containers/*/*.log {
        rotate 7
        daily
        compress
        size=1M
        missingok
        delaycompress
        copytruncate
      }
      

      You can play around with the options. They are all documented in logrotate‘s man page.

    2. Use alternate logging for your containers by specifying the --log-driver option when creating a container:

      $ docker run --log-driver=syslog your_image
      

      Available drivers are documented in the official documentation. You can for example use --log-driver=syslog to use the system’s syslog daemon, target various cloud services or disable logging entirely by using --log-driver=none.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.