Get the most out of your Centmin Mod LEMP stack
Become a Member

Docker Memcached CentOS 6.6 + Memcached 1.4.22 Docker Image

Discussion in 'Centmin Mod Docker Development' started by eva2000, Feb 21, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    53,554
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:33 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Optimised CentOS 6.6 Memcached docker size by 20% from 519MB to 417MB :)


    Code:
    docker images
    REPOSITORY                      TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
    centminmod66min-memcached       latest              xxx        About a minute ago   417.5 MB
    centminmod/centos66-memcached   latest              yyy       39 hours ago         519.7 MB
     
  2. Guilherme Jaccoud

    Guilherme Jaccoud Member

    63
    30
    18
    May 29, 2014
    Ratings:
    +30
    Local Time:
    11:33 PM
    That's nice, in Docker world slim = fast

    My very first Docker image was a 699.8 MB CentminMod.07 image, with all services running inside the container :ROFLMAO:... I had no idea of what I was doing. It's still privately hosted at Quay.io. If you are interested in having a look, just let me know.
     
  3. eva2000

    eva2000 Administrator Staff Member

    53,554
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:33 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah I just googled 'optimize docker image size' or 'reduce docker image sizes' and read dozen of articles regarding docker layers and how it contributes to docker image sizes :) It partly comes down to how you lay out your Dockerfile for RUN/other commands ;)

    CentOS 7 Memcached docker image optimised much better though at 274MB :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,554
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:33 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    7:33 PM
    Just reading up on this as I'm exploring Docker a bit lately.

    Your benchmarks are using two different networking stacks... For docker, you're using the default docker network proxy, which is great for network isolation, but really poor performance-wise because it's a userspace process. I suspect in this case it's the primary cause of slowness.

    You should try exact same benchmarks using the flag `--network=host` when running your docker containers to tell docker to hook into IPTables for network layer. That way you're actually testing the difference between the memcache versions, not between loopback vs docker proxy networking.
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,554
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:33 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes that is the case :)

    haven't touched Docker much these days besides my Ubuntu nghttp2 image :)
     
  7. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    7:33 PM
    I just ran redis-benchmark suite against docker redis 2.8 vs EPEL 2.8 installed directly in the VM. It's a KVM, so somewhat isolated to noisy neighbor, but definitely not the most scientific as I'm serving a small amount of live traffic on the box as well.

    For the simple tests like SET GET etc docker-based was slower than I expected... but for longer tests they were mostly comparable.

    So apparently there still is noticable network/switching overhead using Docker. Not anywhere near as bad as your memcache benchmarks above, but enough that it's probably 10%-20% to switch in/out, but once within the process it's equivalent.
     
  8. eva2000

    eva2000 Administrator Staff Member

    53,554
    12,135
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,678
    Local Time:
    12:33 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah I'd expect overhead still. Guess we can't all have our cake and eat it all :D