0

I am using db2 on docker with a self non-root installation.

Even if I set the INSTANCE_MEMORY to the minimum, it seems to reserve 4G of RAM on the server. How can DB2 be aware of the limits setted in the docker-compose file as I run the database in a docker swarm cluster as a STACK?

The DB2 version is 11.1.4FP4.

docker --version
Docker version 18.03.1-ce, build 9ee9f40

When I look at the docker stats, it uses only about 80MiB.

CONTAINER ID        NAME                                     CPU %               MEM USAGE / LIMIT   MEM %               NET I/O             BLOCK I/O           PIDS
8282c5d0c9e7        db2wse_db2.1.waalf6vljuapnxlvzhf2cb0uv   0.21%               76.83MiB / 1GiB     7.50%               0B / 0B             408MB / 6.86GB      56

My docker-compose.yml file

version: "3.3"
services:
  db2:
    image: docker-registry.ju.globaz.ch:5000/db2wse:11.1.4fp4
    networks:
     - network-db
    deploy:
      mode: replicated
      replicas: 1
      resources:
        limits:
          memory: 1G
networks:
  network-db:
    external: true

Any idea ? It is very frustrating. Thanks a lot

  • What do you mean with reserve 4 GB, how do you measure? How did you install Db2 into Docker? What is instance_memory? – data_henrik Jan 11 '19 at 09:36
  • @data_henrik : the instance memory : db2 update dbm cfg using INSTANCE_MEMORY 131072; the installation is done with a response file in the Dockerfile; The only measurement I make is that I can only start 8 stacks before I get exceptions and the db doesn't start. – Raphael Perrin Jan 11 '19 at 09:46

1 Answers1

1

I found the problem.

It was a kernel configuration in the sysctl.conf.

I had this :

cat /etc/sysctl.conf |grep vm.
vm.swappiness=10
vm.overcommit_memory=2
vm.dirty_ratio=2
vm.dirty_background_ratio=1

I removed everything setted for DB2 (put back the default configuration) and now I can take advantage of all the RAM of the hosts.

I kept this :

cat /etc/sysctl.conf |grep vm.
vm.swappiness=10
vm.max_map_count=262144

Thanks