Outils pour utilisateurs

Outils du site


tech:docker_nproc_nombre_maximum_de_process

Ceci est une ancienne révision du document !


Docker nproc nombre maximum de process

Docker nproc Nombre maximum de process

Erreur java.lang.OutOfMemoryError: unable to create new native thread

Exemple SystemD Docker

# CTR=`docker run --pids-limit 111 --detach --rm busybox /bin/sleep 8h`
# cat /sys/fs/cgroup/pids/system.slice/docker-${CTR}.scope/pids.max
111
# systemctl show docker-$CTR.scope | grep TasksMax
TasksMax=18446744073709551615
# systemctl disable --now postfix
# systemctl enable --now postfix
# cat /sys/fs/cgroup/pids/system.slice/docker-${CTR}.scope/pids.max
max

Source : https://access.redhat.com/solutions/3666581

Exemple de configuration du daemon Dockerd

Option --default-pids-limit=-1

/etc/sysconfig/docker
# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled --log-driver=json-file --signature-verification=false --default-pids-limit=-1'

Diag sur OpenShift

# oc debug node/$NODE_NAME
# chroot /host
# cgroup=$(awk -F: '/:pids:/{print $3}' /proc/self/cgroup)
# cat /sys/fs/cgroup/pids/"${cgroup}"/pids.max
  4096

Source : https://access.redhat.com/solutions/4074511

Exemple de création de conteneur

sudo docker create --name bankapp-inst -it \
  --sysctl fs.mqueue.msg_max=10000 \
  --sysctl fs.mqueue.msgsize_max=1049600 \
  --sysctl fs.mqueue.queues_max=10000 \
  --ulimit msgqueue=-1 \
  --ulimit nproc=256:512 \
  bankapp

Source : https://github.com/endurox-dev/endurox-docker

tech/docker_nproc_nombre_maximum_de_process.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki