1

We are created a wordpress container using mesos-Marathon, we allocated 0.1 CPU and 64mb RAM.

When we check the docker stats, we observed that memory allocations we differed with what we are allocated in marathon, Is there any way to update memory usage limit for Docker container, can we set up any default limits for all containers at demon level.(By Mesos / Docker demon level)

We try do load test on WordPress site, container got killed for just 500 connections, we try to do load test using JMeter.

Thanks in Advance

Rico
  • 58,485
  • 12
  • 111
  • 141
Rajiv Reddy
  • 153
  • 1
  • 9

1 Answers1

1

Docker doesn't have a memory option for your docker daemon yet. As to what is the default memory limit for containers you can only set limits at runtime (not after runtime) with the following options:

-m, --memory=""               Memory limit
--memory-swap=""              Total memory (memory + swap), '-1' to disable swap

As per this

I also see that there's still in issue open here. Make sure you are using Mesos (0.22.1) or later.

How about creating your containers with something like this Marathon request?

curl -X POST -H "Content-Type: application/json" http://<marathon-server>:8080/v2/apps -d@helloworld.json

helloworld.json:
{
    "id": "helloworld",
    "container": {
        "docker": {
            "image": "ubuntu:14.04"
        },
        "type": "DOCKER",
        "volumes": []
    },
    "cmd": "while true; do echo hello world; sleep 1; done",
    "cpus": 0.1,
    "mem": 96.0,  # Update the memory here.
    "instances": 1
}
Rico
  • 58,485
  • 12
  • 111
  • 141
  • Hi Ricardo, We can do this, but we had a problem with Mesos, Once an offer is allocated to any matathon app(Docker container),even the container is not using those allocated resources, Mesos thinks like the offer is already allocated. example.. we have 3 mesos-slave, all are identical, having 4 cores and 4GB RAM, we have 20 Marathon apps all are identical,having 0.5core and 0.5GB . that means 10 Cores and 10 GB was allocated(Even they are utilizing or not), if I try to up anther Marathon app with 3cores and 3GB RAM, Mesos is allocating the resources but app is stuck in Deployments. – Rajiv Reddy Aug 18 '15 at 05:32
  • How can we add "memory.limit_in_bytes", "memory.max_usage_in_bytes" permanently so that if I up an container, it can inherit these values and start the container. – Rajiv Reddy Aug 18 '15 at 05:35
  • To make use of allocation slack in Mesos, you may try out oversubscription (http://mesos.apache.org/documentation/latest/oversubscription/). – rukletsov Aug 18 '15 at 07:14
  • Don't think you can modify resources on the fly. Try oversubscription like @rukletsov mentioned – Rico Aug 18 '15 at 17:33