roadrunner-server / roadrunner

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

[🐛 BUG]: RoadRunner not respecting `num_workers` configuration on `http` #1968

Closed DenisJunio closed 4 months ago

DenisJunio commented 4 months ago

No duplicates 🥲.

What happened?

I encountered an issue where the num_workers setting in the .rr.yaml configuration file is not being respected for the HTTP service. Despite setting num_workers to 1, RoadRunner is still spawning workers based on the number of CPU cores.

Expected Behavior: RoadRunner should respect the num_workers setting and spawn only 1 worker as configured.

Current Behavior: RoadRunner spawns multiple workers based on the number of CPU cores, ignoring the num_workers configuration for the HTTP service. Interestingly, the num_workers setting works correctly for the jobs service.

Version (rr --version)

2024.1.5

How to reproduce the issue?

  1. Configure as follows: .rr.json (converted from .rr.yaml)

  2. Run the command rr workers to check the number of workers:

    rr workers

    image

  3. Run the command rr reset and rr workers to check the number of workers again:

    rr reset
    rr workers

Additional Information:

Relevant log output

No response

rustatian commented 4 months ago

Hello @DenisJunio 👋

Are you using .rr.yaml or .rr.json for that service in the Docker?

BTW: There is no reload plugin.

rustatian commented 4 months ago

I tried to use your configuration (in json) as I see only 1 worker:

image
  1. Double check if you don't have any RoadRunner instance listening on the same port (this is possible to start 2+ RR instances on the same port).
  2. Try to check on the separate environment (to exclude environment issue). E.g.: start RR with the same configuration locally.
DenisJunio commented 4 months ago

Thank you for the quick response and assistance.

I will conduct more tests on my side as it appears the issue might be related to my configuration, particularly with Laravel Octane. Based on this, I will close the issue for now.

Thanks for your help!

rustatian commented 4 months ago

Sure, feel free to join our Discord server if you'd have additional questions 😃