roadrunner-server / roadrunner

🤯 High-performance PHP application server, process manager written in Go and powered with plugins
https://docs.roadrunner.dev
MIT License
7.86k stars 409 forks source link

[Q] RR2 configuration used in RR1 #745

Closed make-it-git closed 3 years ago

make-it-git commented 3 years ago

I have symfony 4.4 application.

This is how i run workers from https://github.com/baldinof/roadrunner-bundle (version 1.5.1, php 7.3)

# RPC_ADDRESS=tcp://127.0.0.1:7000 LISTEN_ADDRESS=0.0.0.0:8080 bin/rr -c .rr.yaml -d -v serve
DEBU[0000] [metrics]: disabled                          
DEBU[0000] [headers]: disabled                          
DEBU[0000] [health]: disabled                           
DEBU[0000] [reload]: disabled                           
DEBU[0000] [rpc]: started                               
DEBU[0000] [http]: started

I expected to see this happen: run 16 workers

Instead, this happened: I see 8 workers (number of logical CPUs)

bin/rr -c .rr.yaml http:workers
+---------+-----------+---------+---------+--------------------+
|   PID   |  STATUS   |  EXECS  | MEMORY  |      CREATED       |
+---------+-----------+---------+---------+--------------------+
|    4138 | ready     |       0 | 45 MB   | 34 seconds ago     |
|    4145 | ready     |       0 | 45 MB   | 34 seconds ago     |
|    4152 | ready     |       0 | 45 MB   | 34 seconds ago     |
|    4161 | ready     |       0 | 45 MB   | 33 seconds ago     |
|    4169 | ready     |       0 | 45 MB   | 33 seconds ago     |
|    4177 | ready     |       0 | 46 MB   | 32 seconds ago     |
|    4185 | ready     |       0 | 45 MB   | 32 seconds ago     |
|    4193 | ready     |       0 | 45 MB   | 32 seconds ago     |
+---------+-----------+---------+---------+--------------------+

The version of RR used: 1.9.2

My .rr.yaml configuration is:

rpc:
  listen: ${RPC_ADDRESS}
http:
  address: ${LISTEN_ADDRESS}
  max_request_size: 16

  uploads:
    forbid: [".php", ".exe", ".bat"]

  workers:
    command: "php bin/console baldinof:roadrunner:worker"
    relay: "unix://var/roadrunner.sock"

  pool:
    num_workers: 16
    max_jobs: 500
    supervisor:
      ttl: 60s
      max_worker_memory: 128
      exec_ttl: 30s

static:
  dir:   "public"
  forbid: [".php", ".htaccess"]

I tried to set num_workers to different values and still see 8 workers running. Tried to change max_jobs to 1 and I do not see workers restart after hundreds of requests to application.

rustatian commented 3 years ago

Hey @make-it-git . You mixed RR2 and RR1 configurations. Use RR1 config https://github.com/spiral/roadrunner/blob/v1.9.2/.rr.yaml or download RR2 and use RR2 configuration https://github.com/spiral/roadrunner-binary/blob/master/.rr.yaml