Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[💡 FEATURE REQUEST]: Dynamic Workers Scaling via RPC #1728

Closed
butschster opened this issue Sep 15, 2023 · 1 comment · Fixed by roadrunner-server/sdk#95
Closed

[💡 FEATURE REQUEST]: Dynamic Workers Scaling via RPC #1728

butschster opened this issue Sep 15, 2023 · 1 comment · Fixed by roadrunner-server/sdk#95
Assignees
Labels
C-feature-request Category: feature requested, but need to be discussed P-HTTP Plugin: HTTP P-jobs Plugin: Jobs
Milestone

Comments

@butschster
Copy link
Contributor

butschster commented Sep 15, 2023

Plugin

JOBS

I have an idea!

Hey there, folks! 😄

RoadRunner offers multiple plugins like http, jobs, and grpc that allow the deployment of workers pools with predefined numbers in the configuration.

version: "3"

http:
  pool:
    num_workers: 0

At present, if there's a need to modify the number of workers, one must stop RoadRunner, modify the configuration, and then start the server again.

There exists an RPC method, informer.Workers, which lets users query the current number of workers for a given plugin.

$result = $rpc->call('informer.Workers', 'http');
var_dump($result['workers']); 

Proposal:

To enhance the operational flexibility and adaptability of RoadRunner, I propose the introduction of two new RPC methods:

  1. server.AddWorker(plugin, number)
  2. server.RemoveWorker(plugin, number)

Benefits:

  1. Dynamic Scaling: By introducing these methods, we provide a way for dynamically increasing or decreasing the number of workers for a specific plugin. This will prove invaluable for system administrators, especially in scenarios where traffic or load is unpredictable.

  2. Efficiency During Peak Hours: For plugins like http or grpc, the ability to dynamically scale workers can be used to manage increased traffic during peak hours. This ensures optimal utilization of resources and smoother user experience.

  3. Adaptable Job Workers: In the context of the jobs plugin, if there's a significant number of tasks in the queue, workers can be scaled up to process the load faster. Conversely, during periods of low activity, the number of workers can be reduced to free up system resources.


The addition of these methods would greatly improve the flexibility of RoadRunner, making it even more attractive for applications that require on-the-fly adaptability.

👍👍👍👍 If you like my proposal and would like to see it implemented, please give this issue a thumbs up! Your feedback plays a crucial role in getting attention from the RoadRunner maintainers.

@butschster butschster added C-feature-request Category: feature requested, but need to be discussed P-HTTP Plugin: HTTP P-jobs Plugin: Jobs labels Sep 15, 2023
@rustatian
Copy link
Member

Hey @butschster 👋🏻
Such a detailed FR, good job ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: feature requested, but need to be discussed P-HTTP Plugin: HTTP P-jobs Plugin: Jobs
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants