Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the message "start worker process" mean when I run a Docker image?

Whenever I execute docker-compose for a particular app of mine, I see printed a flurry of "start worker process" messages:

2022/03/31 19:24:42 [notice] 1#1: start worker processes
2022/03/31 19:24:42 [notice] 1#1: start worker process 77
2022/03/31 19:24:42 [notice] 1#1: start worker process 78
2022/03/31 19:24:42 [notice] 1#1: start worker process 79
2022/03/31 19:24:42 [notice] 1#1: start worker process 80
2022/03/31 19:24:42 [notice] 1#1: start worker process 81
2022/03/31 19:24:42 [notice] 1#1: start worker process 82
2022/03/31 19:24:42 [notice] 1#1: start worker process 83

I'm guessing this message is a very generic one and that's why I can't find any discussions about it. Nevertheless I'm interested to know:

  • what process/software/daemon/package is responsible for printing the message
  • what types of events triggers the message

docker-compose.yml file:

version: '3.4'

services:

  nginx:
    build:
      network: host
      context: cfg/nginx/.
    ports:
      - "80:80"
    volumes:
      - web-static:/var/www/web_reflectivity/static
      - ./cfg/nginx/django.conf:/etc/nginx/conf.d/django.conf
      - ./cfg/nginx/docker-entrypoint.sh:/docker-entrypoint.d/docker-entrypoint.sh
    depends_on:
      - web

  web:
    restart: always
    build:
      network: host
      context: src/.
    hostname: web
    expose:
      - "8000"
      - "22"
    volumes:
      - ./src:/var/www/web_reflectivity/app
      - web-static:/var/www/web_reflectivity/static
      - ./src/docker-entrypoint.sh:/usr/bin/docker-entrypoint.sh
    env_file:
     - .env
    command: /usr/bin/docker-entrypoint.sh
    depends_on:
      - db
      - redis

  db:
    restart: always
    image: code.ornl.gov:4567/rse/images/postgres:9.6.23
    env_file:
     - .env
    ports:
      - "${DATABASE_PORT}:${DATABASE_PORT}"
    volumes:
      - pgdata:/var/lib/postgresql/data

  redis:
    image: code.ornl.gov:4567/rse/images/redis:6.2.5
    expose:
      - "6379"
    volumes:
      - /tmp/log/web_reflectivity/redis:/var/log
      - ./cfg/redis/redis.conf:/usr/local/etc/redis/redis.conf
    command: redis-server /usr/local/etc/redis/redis.conf

  worker:
    image: code.ornl.gov:4567/rse/images/refl1d:0.8.15
    volumes:
      - ./cfg/worker/docker-entrypoint.sh:/opt/refl1d/docker-entrypoint.sh
    env_file:
      - .env
    expose:
      - "22"
    command: /opt/refl1d/docker-entrypoint.sh

volumes:
  pgdata:
  web-static:
like image 670
jmborr Avatar asked Nov 16 '25 12:11

jmborr


1 Answers

nginx spawns processes to deal with incoming requests as they come.

From the beginner's guide:

nginx has one master process and several worker processes. The main purpose of the master process is to read and evaluate configuration, and maintain worker processes. Worker processes do actual processing of requests. nginx employs event-based model and OS-dependent mechanisms to efficiently distribute requests among worker processes. The number of worker processes is defined in the configuration file and may be fixed for a given configuration or automatically adjusted to the number of available CPU cores

like image 186
jmborr Avatar answered Nov 18 '25 20:11

jmborr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!