[💡 FEATURE REQUEST]: `max_workers_unavailable` Option for HTTP Plugin
Plugin
HTTP
I have an idea!
I have an idea, listen to me!!
Summary:
Introduce a new configuration option max_workers_unavailable within the http.pool.supervisor section of the HTTP plugin. This option will specify the maximum percentage of workers that can be unavailable (due to restart or other reasons) while ensuring that a certain number of workers remain "alive".
Description:
In the current implementation of the HTTP plugin, managing worker availability during restarts can be challenging, especially under high load. To enhance the reliability and stability of the service, I propose adding a new configuration option max_workers_unavailable to the http.pool.supervisor section. This option will allow users to define the maximum percentage of workers that can be unavailable during a restart process.
Configuration:
The value of max_workers_unavailable can be an absolute number or a percentage of desired workers. This value indicates the exact number or proportion of the total worker pool that can be unavailable at any given time. For instance, setting max_workers_unavailable to 20% means that up to 20% of the workers can be restarted simultaneously, while ensuring that at least 80% of the workers remain operational.
The default value is 100% like it is implemented now.
Example:
http:
pool:
supervisor:
max_workers_unavailable: 20% # Ensures at least 80% of workers remain "alive"
http:
pool:
supervisor:
max_workers_unavailable: 10 # Ensures only 10 workers can be restarted at once
Benefits:
Increased Stability: By controlling the number of unavailable workers, the system can handle high loads more gracefully without significant performance degradation.
Flexibility: Users can customize the availability threshold based on their specific requirements and load characteristics.
Improved Reliability: This feature will help prevent scenarios where too many workers are restarted simultaneously, leading to potential downtime or performance issues.
Use Case:
Consider a scenario where a service experiences a surge in traffic and needs to restart workers by ttl. With the max_workers_unavailable option, we can ensure that a sufficient number of workers remain operational to handle incoming requests, thus maintaining service availability and performance.