You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently, we start a different event loop per protocol (one for HTTP, one for HTTPS, one for TCP), and this results in duplicate workers.
One worker should be able to handle all of the configured protocols. This means having the Server struct (in src/network/proxy.rs) not generic on the type of protocol, but decide everything at runtime.
This is a good occasion to refactor the TCP proxy with the other ones, since it already requires multiple listening addresses (other protocols listen on only one socket currently). Message dispatching would be done more on the workers than on the master.
The sockets related for each type of proxy should have different ranges in their token identifiers.
What is the performance impact of deciding at runtime what to do with a socket? Can some parts stay generic over the protocol type?
since d7b2dbe it's working, but the design is still a bit awkward.
The token space is currently separated in 3, so in one instance of the proxy, there is only one of each proxy type (HTTP, HTTPS or TCP). (2^64 -1)/3 is still a pretty big address space, but the calculation for token ranges complexifies the code a bit.
The executable does not support yet the merge, currently every proxy type has its own set of workers.
Should we also merge the code that finds an app id based on the domain and possible URI prefix? If we centralized that code, we could move up connections to backend as well and merge the implementations. The HTTP and TLS proxy would only handle buffers and network.
as of 97b47fd all the crates support the new scheme. There are no more tags, every worker handles everything. A few bugs might appear due to the refactoring, so let's wait a bit for more tests before closing that bug.
Activity
Geal commentedon Apr 12, 2017
Plan:
ProxyConfiguration( https://github.com/sozu-proxy/sozu/blob/master/lib/src/network/proxy.rs#L151 ) stays nearly the same: transformation methods for front and back tokens will add a base token integer depending on the chosen rangeServer<ServerConfiguration,Client>( https://github.com/sozu-proxy/sozu/blob/master/lib/src/network/proxy.rs#L161 ) splits in two parts:readymethod). Maybe this could move toProxyConfiguration?runmethod) that separates its token space in 3 (HTTP, HTTPS and TCP):startmethods stay the same for easy usage, maybe? Or we just start one proxy of the required kindseparating the token space in 3 should leave enough token for every kind (it's a usize).
Geal commentedon Apr 13, 2017
since d7b2dbe it's working, but the design is still a bit awkward.
The token space is currently separated in 3, so in one instance of the proxy, there is only one of each proxy type (HTTP, HTTPS or TCP). (2^64 -1)/3 is still a pretty big address space, but the calculation for token ranges complexifies the code a bit.
The executable does not support yet the merge, currently every proxy type has its own set of workers.
Geal commentedon Apr 16, 2017
Should we also merge the code that finds an app id based on the domain and possible URI prefix? If we centralized that code, we could move up connections to backend as well and merge the implementations. The HTTP and TLS proxy would only handle buffers and network.
KellerFuchs commentedon Apr 17, 2017
FWIW, I would expect it to be very low overhead in most cases (due to branch prediction).
Geal commentedon Apr 20, 2017
as of 97b47fd all the crates support the new scheme. There are no more tags, every worker handles everything. A few bugs might appear due to the refactoring, so let's wait a bit for more tests before closing that bug.