This repository was archived by the owner on Sep 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Hiding the logging latency by parallelizing logging and execution. Overall latency is cut down almost by 40% #114
Draft
zllai
wants to merge
570
commits into
microsoft:master
Choose a base branch
from
zllai:parallel_logging
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Talzacc/codegen new
Rare concurrecy bug fixes
…oft#32) * Change variable names to match Ambrosia terminology change * Add quick start instructions to UWPExample README * Update UWPExample codegen script and improve error messages
Refactoring CodeGen tool
… doing license to the new way of "license"
… due to new License element
…into Updating_CRA
…d. VS handled it ok but MSBuild in DevOps failed
…S ... same for the Debug version too
…CRA Version=2019.8.8.2
…into Updating_CRA
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Ambrosia team,
I am recently studying the ambrosia source code, seeking for a chance to contribute to this project. As I playing around with it and getting familiar with its source code, I think I may be able to contribute a little now.
In current implementation of Ambrosia, when an immortal receives a request, it will log it before the application code get a chance to process the query. It makes sense in order to enable resiliency. However it could also harm the overall response latency. As a proof of theory, I made an image resize service where the client immortal sends an image to the server and the server resize it to the desired size and returns to the client. In my experiment, the logging latency of server is about 40ms, and resizing takes around 30ms. These add up to the overall latency about 80ms.
I think it might be possible to put logging out of critical path so that the latency won't add up while ensuring resiliency and no side effect is made before the request is stable in resilient storage. Here is my proposal:
After a immortal receives a request and write it to buffer page (at this point, the total order of messages is established), the request is directly sent to the application to process. In the mean time, the immortal coordinator (IC) tries to log it in resilient storage. The application may send out several messages after processing this request. Those messages are sent back to IC and stored in the output queue of IC. However, those messages are hold in the output queue until the request is confirmed to be logged in the resilient storage.
In this way, logging and processing is made parallel so that the logging latency is hidden. Since the output is hold until the input is logged, no side effect is made.
I implemented this idea and done some experiments in the image resize application.
Here is the result:
The first 6 columns show the latency for various percentiles and the last column is the average latency.
The preliminary result shows about 36% reduction in latency, which I think could be promising.
May I know your comments about this idea? And of course I will continue to refine my code.
Best,
Ziliang