1.0.0-rc6: Resources limitation (global) possible?

Hello everybody,
at the moment I try out drone 1.0.0-rc6 and drone latest (single-machine and multi-machine).
In drone 0.8.x I could limit the resources “globally” by setting them as environment variables, so no need to puth these in a .drone.yml:


Is this possible in the current (rc)-version of drone without taking these entries in the .drone.yml?
Or is there a way to set these limits for all pipeline steps as variable, so that not every step has to be explicit limited?

Another question would be:
Who basically limits a multi-machine (drone-server or drone-agent)?
With multi-machine, the drone-agent should “deliver” these settings, right?


# change the cpu shares
# set the cpus allowed to execute containers

Configuration multi-machine (drone-server):

docker run \
  --volume=/var/lib/drone:/data \
  --env=DRONE_GIT_ALWAYS_AUTH=false \
  --env=DRONE_TLS_AUTOCERT=false \
  --publish=80:80 \
  --publish=443:443 \
  --restart=always \
  --detach=true \
  --name=drone \

Configuration multi-machine (drone-agent):

docker run \
  --volume=/var/run/docker.sock:/var/run/docker.sock \
  --env=DRONE_RUNNER_NAME=agent-smith \
  --restart=always \
  --detach=true \
  --name=drone-agent \

Unfortunately, my configuration does not work as desired.
On the drone-agent side all available (4) cpu cores are running. The limitation is not executed.

Same behaviour here with drone 1.6.2.
I set resource limits parameters to my agents:

            - "DRONE_MEMORY_LIMIT=4294967296"  # 4Go
            - "DRONE_MEMORY_SWAP_LIMIT=0"
            - "DRONE_CPU_SHARES=100"           # Low CPU priority
            - "DRONE_RUNNER_MAX_PROCS=3"

I see the vars when I docker inspect an agent, but the build containers have no docker resource limitations when I docker inspect them.

You should be using drone/drone-runner-docker instead of drone/agent. The documentation references the former, and the latter was deprecated. You can find the list of valid configuration parameters at https://docs.drone.io/runner/docker/configuration/reference

1 Like

Works like a charm with drone/drone-runner-docker :+1: