Re: RFC: Master Workers model

2017-04-26 Thread Willy Tarreau
On Wed, Apr 26, 2017 at 03:39:50PM +0200, William Lallemand wrote:
> This is a work in progress set of patches.
> 
> The current systemd model works this way:
> 
> - systemd-wrapper
>   ` haproxy master
>  ` haproxy child
>  ` haproxy child
>  ` haproxy child
> 
> The master workers model will allow you to have the same architecture, but
> without the systemd wrapper at the top.
> 
> In practice:
> 
> * You won't need an additional binary
> * It will work either in background or foreground mode (systemd compatibility)
> * You can send directly the USR2 signal to the master to reload
> * Use the same exit codes as the systemd-wrapper
> * The master manage the parsing of the configuration file
> * The master is aware of current and previous children
> 
> Near future:
> 
> * (TODO) Children will exit at the exit of the master
> * (TODO) Check if the children are ready on a reload
> * (TODO) Transparent use of the new -x option for seamless reload
> 
> Ideas/unplanned/distant future:
> 
> * Stop using kill to reload and use a synchronous method to return a status 
> code to the init.
> * Have a poll loop in the master for signals and stuff.

And for the near-mid-future we also discussed about the benefits of
having the new haproxy process directly send the signal to the previous
one after checking the conf, to make it easier to manage (ie: knows
where the pidfile is, etc).

Thanks for publishing this work, I think it will be a nice improvement.
Willy



RFC: Master Workers model

2017-04-26 Thread William Lallemand
This is a work in progress set of patches.

The current systemd model works this way:

- systemd-wrapper
  ` haproxy master
 ` haproxy child
 ` haproxy child
 ` haproxy child

The master workers model will allow you to have the same architecture, but
without the systemd wrapper at the top.

In practice:

* You won't need an additional binary
* It will work either in background or foreground mode (systemd compatibility)
* You can send directly the USR2 signal to the master to reload
* Use the same exit codes as the systemd-wrapper
* The master manage the parsing of the configuration file
* The master is aware of current and previous children

Near future:

* (TODO) Children will exit at the exit of the master
* (TODO) Check if the children are ready on a reload
* (TODO) Transparent use of the new -x option for seamless reload

Ideas/unplanned/distant future:

* Stop using kill to reload and use a synchronous method to return a status 
code to the init.
* Have a poll loop in the master for signals and stuff.

Don't hesitate to comment. The documentation will come with future patches.