# Docker runner resource limit does not work

**URL:** <https://drone.discourse.group/t/docker-runner-resource-limit-does-not-work/8823>\
**Category:** Drone Bugs\
**Created:** [March 31, 2020, 10:44pm UTC](https://drone.discourse.group/t/docker-runner-resource-limit-does-not-work/8823 "2020-03-31T22:44:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![1mdc](https://avatars.discourse-cdn.com/v4/letter/1/f04885/32.png) [@1mdc](https://drone.discourse.group/u/1mdc)\
**Post date:** [March 31, 2020, 10:44pm UTC](https://drone.discourse.group/t/docker-runner-resource-limit-does-not-work/8823/1 "2020-03-31T22:44:04Z")

</div>

This is my simple docker compose file:

```auto
version: '2.4'

services:
  drone-server:
    image: drone/drone:1
    restart: unless-stopped
    networks:
      - default
      - web
    environment:
      - DRONE_USER_CREATE=$DRONE_USER_CREATE
      - DRONE_USER_FILTER=$DRONE_USER_FILTER
      - DRONE_GITHUB_CLIENT_ID=$DRONE_GITHUB_CLIENT_ID
      - DRONE_GITHUB_CLIENT_SECRET=$DRONE_GITHUB_CLIENT_SECRET
      - DRONE_RPC_SECRET=$DRONE_RPC_SECRET
      - DRONE_SERVER_HOST=xxxx
      - DRONE_SERVER_PROTO=https

  drone-runner:
    image: drone/drone-runner-docker:1
    restart: unless-stopped
    networks:
      - web
      - default
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_RPC_SECRET=$DRONE_RPC_SECRET
      - DRONE_RPC_PROTO=http
      - DRONE_RPC_HOST=drone-server
      - DRONE_RUNNER_NAME=drone-runner
      - DRONE_RUNNER_CAPACITY=2
      - DRONE_CPU_SHARES=16
      - DRONE_MEMORY_LIMIT=4000000000
      - DRONE_MEMORY_SWAP_LIMIT=0

```

apparently the created containers always use maximum resource from my server rather than the amount that I specify in the variable (4GB).

```auto
e5a5bc96db27 drone-onFA28oii6HGBBvU7Mdu 271.95% 355.6MiB / 251.9GiB 0.14% 918B / 0B 0B / 0B 55

```
