-
Notifications
You must be signed in to change notification settings - Fork 25
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
RAM usage #32
Comments
Maybe it comes from this line: https://github.com/hrxi/tracing-loki/blob/master/src/lib.rs#L513 I see that here https://github.com/hrxi/tracing-loki/blob/master/src/lib.rs#L542 it should drop something, but given the memory usage it does not seem to happen |
Logs do reach Loki, and there I can see as up to as 50logs per second. Loki is on the cloud, latency is around 100ms to reach the server. btw I was digging on the code and I do not understand why the backgroud task does not send the event directly instead of pushing them into two Seem to batch some of those logs, but as a results makes the whole architecture quite complex. |
Yes, the idea is to have at most one outgoing HTTPS request at a time, and always push all available log messages when starting a new HTTPS request. |
I tried to change the code to push the log line directly after the From almost 100MB in 15m to 15MB in 15m and in general seems very stable. I'm wondering if the OFC the period should be configurable. |
Doing some pseudo code.
Still max one outstanding request, but memory should be bounded by the channel size (that should be also configurable). |
FWIW Started using this crate today and experienced similar uncontrolled memory growth. Although I haven't yet proven the connection. |
This seems to produce some (IMO) unnecessary sleeping that delays some log events even if nothing else happens. I don't quite like introducing artificial latency. I'll take a look at your PR. |
Been running it for a few days at some solid volumes (~10K TPM) without any issues. Thank you. |
@hrxi this seems indeed to solve the issue, in the PR I made anyway the period configurable, we are also using it internally for a week now. |
Hi, first thank you for this crate.
I've noticed an issue about memory usage when I push logs to loki using this crate.
I can see that the RAM continues to grow until the process gets killed for OOM.
while when not using it I can see the RAM usage to be stable
I can see the same behaviour using the Insturment application on macOS
That's how I'm configuring it:
The text was updated successfully, but these errors were encountered: