Comments (5)
The BufferLimit
parameter is to configure the (max) number of pending messages to be sent. It's not the size of memory space. The change in #63 is intentional, and meaning was not changed. The original code make(chan []byte, num)
is not to allocate a bytes array, but to allocate a channel for byte arrays.
We should add a clear document to describe it. But it's not a bug, nor an unintentional change.
from fluent-logger-golang.
Thanks for clarifying. I think clear documentation would be very helpful and appreciated here.
After looking more closely I think I might have misidentified where the change in meaning happened but this sort of seems like it's changing the meaning since before it was accepting []byte into appendBuffer() here and erroring if the len(new bytes) + len(pending bytes) > BufferLimit (which was presumably also in bytes?). Apologies if I'm reading this incorrectly. I want to be sure I understand the issue correctly so I can figure out and work on whatever fix is appropriate in the linked Moby issue.
Also, do you consider it a performance regression to pre-allocate 8x the memory with the same parameters post #63 as opposed to pre #63?
from fluent-logger-golang.
I checked the change you pointed (this). And yes, it changes the semantics of BufferLimit
. It was the limit of actual memory space (the max length of []byte
) but now it's the max number of pending []byte
objects in the channel.
At the time when I reviewed that change, I thought it's ok because it also changes the default value (8M -> 8k).
I missed the case that users specify very large values like Gigabytes because it's just the on-memory pool, and its contents should be flushed to anywhere else as soon as possible (for example, Fluentd on other hosts). Logs on on-memory pools can be dropped easily due to many reasons (including host failure).
So, as my conclusion, it's a kind of regression, but it's not a serious problem because I expect it doesn't affect most users' use-cases.
Of course, I'll change my opinion if I know my idea was wrong... and I'll add clear descriptions about configuration parameters on README anyway.
@IRCody does it answer to your question?
from fluent-logger-golang.
Yes it does. thanks @tagomoris. I agree it's sort of an outlier case.
My prompting for making this issue was the linked issue where dockerd's fluent logdriver. My understanding was that they wanted confirmation that this was indeed a change made in this library to inform the fix that would be made in the docker logdriver. Thanks for acknowledging the change here. I will update that ticket here to see how they want to proceed.
from fluent-logger-golang.
Let me close this ticket. And feel free to reopen if other comments / any commits are needed.
from fluent-logger-golang.
Related Issues (20)
- tagomoris will step down from the maintainer HOT 4
- Disordered Ack messages will be missed HOT 3
- Calls to Write() after calling Close() in sync mode reopen the connection HOT 5
- Migrate testing to Go's testing package HOT 1
- Release v1.8.0 HOT 5
- Feature: periodically reconnect to fluentd-address HOT 1
- Add a new option TLSCertPath
- Option to skip loggertag and timestamp
- Support for fluentd `shared_key` and `user_auth`
- Panic if TLS fluentd server cannot be connected
- Support to take TLS certificate in case of tls enabled
- Fluent-bit Supported
- RequestAck usage
- What should be the source configuration to use fluent-logger-golang? HOT 1
- Add WithContext methods to Fluent struct
- Unknown writing error: MaxRetry shows zero HOT 3
- Update README to describe Config parameters clearly HOT 1
- How to forward output plugin records HOT 3
- Passing struct pointers to `Post` method HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluent-logger-golang.