-
Notifications
You must be signed in to change notification settings - Fork 199
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
Transmit config to new worker with a protobuf type + protobuf channels #1000
Conversation
542a679
to
64920c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Great update!
We merged #1001, a unique commit, into this branch, here is the abstract of this PR: This is the last step in the implementation of protobuf in Sōzu: use protobuf for all communications of Sōzu, within and without. See #1000 Coded with @Wonshtrum , this PR:
Here is a simple benchmark of performance improvements:
|
2e8a15e
to
33d8150
Compare
29f6af0
to
a17a585
Compare
a17a585
to
323171d
Compare
ee289e6
to
b87ada8
Compare
190f5b4
to
58314d0
Compare
49764d2
to
b063ac4
Compare
c6005ec
to
81dc275
Compare
81dc275
to
47ebb9f
Compare
9bd9a79
to
17f3ba8
Compare
6a72c6f
to
bb876ee
Compare
previously, a whole Config was passed to the new worker, which is overkill, and will not be translatable to protobuf. ServerConfig contains only the necessary infos.
since buffer size config will be transmitted in protobuf using the uint64 type.
Co-Authored-By: Eloi DEMOLIS <[email protected]>
bb876ee
to
cc0a221
Compare
When a new worker is created, the whole
Config
object is passed to it:sozu/bin/src/worker.rs
Lines 340 to 342 in bc49d7f
This
Config
object contains necessary infos, like timeouts, but also proxy business infos like clusters, frontends etc. that are not used directly and are re-sent to the new worker later on in a different form.Since we strive to have a protobuf-only communication both without and within Sōzu,
and since the
Config
object can be translated to protobuf only with difficulty, and no real purpose (as most of it is unused),this PR changes the passing of the
Config
object to aServerConfig
. This struct was already derived fromConfig
, was present in the Sōzu lib, but now:This PR paves the way to changing the Sōzu channels in order to stop serializing structs to JSON, but to make use of the protobuf binary serialization.
One thing remains in a JSON form, though: requests written to a state file and passed to sōzu using a
LoadState
message.