-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Updating kafka logger to use the batch processor util #1358
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1381ad7
Updating kafka logger to use the batch processor util
sshniro 3012767
Using the internal buffer to buffer request instead of the kafka lib
sshniro 62d89bc
Updating the kafka logger
sshniro 0762f5e
Merge branch 'master' into kafka-batch-update
sshniro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
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.
I have one question:
If there are no more new logs to be sent later, how to release the
log_buffer
object?If the log_buffer is useless, how to delete it from
buffers
? If we don't delete it, it will make thebuffers
bigger.we need to control the max count number of
timer
. the default value is 1024 for each worker process.https://github.com/openresty/lua-nginx-module#lua_max_pending_timers
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.
Yes, @membphis I was also thinking about this problem,
For the memory problem:
we need to write a timer function which executes in all active loggers and finds stale buffer objects and remove the variable. Maybe it can run every 30 mins?
For the timer problem:
The buffer by default has an inactive timeout. If we don't send any logs for 30 seconds, by default it will send the existing logs and will not create any additional timers. Due to this fact, we won't be creating timers for inactive buffers. Only active buffers will have a timer running.
If we agree on the memory optimization technique, then I can send the fix in another PR.
A practical bottleneck is if a user configures like 1024 routes with a logger and actively using all the routes.
But I assume its not a practical scenario. To tackle this scenario we might have to have a global logger instead of a route based logger.
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.
I have created an issue to remove stale objects from memory:
#1494
The following issue is to create a global logger, to resolve the issue from having more than 1024 loggers running concurrently:
#1492
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.
@membphis any update on this?