-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep the log fd, don't re-open logfile in every logs
Currently in serverLog, we fopen and fclose the logfile in every call, if the log prints too much, it will waste performance. Also frequent open may cause blocking in some caes. We have encountered open blocking for hundreds of milliseconds to seconds. In this PR, we keep the log fd, and only re-open it when dir changed. This also improve performance, using benchmark DEBUG log shows that it improves the performance by 3 times. Signed-off-by: Binbin <[email protected]>
- Loading branch information
1 parent
370bdb3
commit cb7cfc1
Showing
4 changed files
with
47 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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