--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Could I suggest that you run tests for latency and throughput effects of using this in systems with only moderate-to-low numbers of logging calls? (i.e. the vast majority of systems!)It's very likely that in such systems messages will not reach a velocity to keep the Dispatcher running, and so logging calls may often (or always) involve a Futex call - which is not a trivial cost. There will almost certainly be systems out there with anti-ideal characteristics - logging just often enough that these costs materially impact throughput, but not often enough that they suddenly disappear.Even though a majority of systems do not need this, because it "async" and the new hotness, and there are no advertised downsides, everyone will try to use it. It's up to those who know better to make sure these people are informed it isn't a free lunch. Making sure all of the caveats are reported on the advertising page would be a great start IMO.Might I also separately suggest you consider filtering events prior to placing them on the queue for processing by the dispatcher? I've only briefly glanced at the code, but it seems not to be the case currently.On 17 May 2016 at 18:50, Benedict Elliott Smith <_...@belliottsmith.com> wrote:Could I suggest that you run tests for latency and throughput effects of using this in systems with only moderate-to-low numbers of logging calls? (i.e. the vast majority of systems!)It's very likely that in such systems messages will not reach a velocity to keep the Dispatcher running, and so logging calls may often (or always) involve a Futex call - which is not a trivial cost. There will almost certainly be systems out there with anti-ideal characteristics - logging just often enough that these costs materially impact throughput, but not often enough that they suddenly disappear.Even though a majority of systems do not need this, because it "async" and the new hotness, and there are no advertised downsides, everyone will try to use it. It's up to those who know better to make sure these people are informed it isn't a free lunch. Making sure all of the caveats are reported on the advertising page would be a great start IMO.Might I also separately suggest you consider filtering events prior to placing them on the queue for processing by the dispatcher? I've only briefly glanced at the code, but it seems not to be the case currently.
Regrettably it seems impossible (or at least very annoying) to send to both lists simultaneously...On 17 May 2016 at 18:55, Benedict Elliott Smith <bene...@apache.org> wrote:Could I suggest that you run tests for latency and throughput effects of using this in systems with only moderate-to-low numbers of logging calls? (i.e. the vast majority of systems!)
It's very likely that in such systems messages will not reach a velocity to keep the Dispatcher running, and so logging calls may often (or always) involve a Futex call - which is not a trivial cost. There will almost certainly be systems out there with anti-ideal characteristics - logging just often enough that these costs materially impact throughput, but not often enough that they suddenly disappear.Even though a majority of systems do not need this, because it "async" and the new hotness, and there are no advertised downsides, everyone will try to use it. It's up to those who know better to make sure these people are informed it isn't a free lunch. Making sure all of the caveats are reported on the advertising page would be a great start IMO.Might I also separately suggest you consider filtering events prior to placing them on the queue for processing by the dispatcher? I've only briefly glanced at the code, but it seems not to be the case currently.
On 17 May 2016 at 18:33, Martin Thompson <mjp...@gmail.com> wrote:
Hi Remko,I'd just like to say that it is a great service to the community as a whole that someone is seriously looking at improving logging.If you keep it up you'll be putting folks like me out of a job :)Martin...
On 17 May 2016 at 18:13, Remko Popma <remko...@gmail.com> wrote:
Hi all,First, my thanks to the many people who gave helpful advice and feedback on how to measure Log4j response time on this list some time ago.We're about to start the Log4j 2.6 release.If anyone is interested, a preview of the garbage-free logging manual page is here: http://home.apache.org/~rpopma/log4j/2.6/manual/garbagefree.htmland a preview of the updated performance page is here: http://home.apache.org/~rpopma/log4j/2.6/performance.htmlFeedback welcome!Remko
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
Ok thanks!
> On Thursday, 19 May 2016 09:36:01 UTC+10, Remko Popma wrote:
> Thank you Martin, appreciated! :-)
>
> On Wednesday, May 18, 2016 at 2:33:55 AM UTC+9, Martin Thompson wrote:
> Hi Remko,
>
>
> I'd just like to say that it is a great service to the community as a whole that someone is seriously looking at improving logging.
>
>
> If you keep it up you'll be putting folks like me out of a job :)
>
>
> Martin...
>
>
>
>
> On 17 May 2016 at 18:13, Remko Popma <remko...@gmail.com> wrote:
>
> Hi all,
>
>
> First, my thanks to the many people who gave helpful advice and feedback on how to measure Log4j response time on this list some time ago.
>
>
> We're about to start the Log4j 2.6 release.
> If anyone is interested, a preview of the garbage-free logging manual page is here: http://home.apache.org/~rpopma/log4j/2.6/manual/garbagefree.html
> and a preview of the updated performance page is here: http://home.apache.org/~rpopma/log4j/2.6/performance.html
>
>
> Feedback welcome!
>
>
> Remko
>
>
>
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "mechanical-sympathy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mechanical-sympathy/klefjRqlpQE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mechanical-symp...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
Hi Remko,I realise that I was looking at the old log4j code without realising it, in which there is always a futex involved.
However the behaviour of the disruptor that backs the new code will depend on the wait strategy employed (and I'll note your default is a blocking strategy, for which my prior statement holds*).
Here we obviously get into the territory of people needing to understand the disruptor as well as your logging framework, but since you have a whole section labelled "Trade-offs" in which you draw attention to the improved throughput and latency profile under "Benefits," under "Drawbacks" it might be nice to mention these possible confounders. Or at least raise a bat signal to go and understand the tradeoffs for the disruptor (which is also regrettably poorly understood).It might also be helpful to explicitly call out the configuration used for your benchmarks,
and perhaps to run a comparison against some real software - github does not lack for applications using log4j! Unfortunately I bet this would result in a much less sexy graph.
Finally, I really think people should (in your wiki page) explicitly be discouraged from using this part of your framework unless they know they need it. It's a fantastic piece of work for people who do need it.
But 99.99% of people would be better off with a logger that just avoids blocking threads when one is already in the process of logging.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
It's possible I'm missing some other aspect that insulates the application thread from the disruptor, but from your message it seems to me that you fall into the all-too-common category of people who do not fully understand the semantics of the disruptor. Application threads (i.e. disruptor producers) very much are affected by the wait strategy. Under normal use, if the disruptor consumer thread is employing a blocking strategy, there will be futex call to unblock it when work is provided. i.e. whenever the queue transitions from empty to non-empty, i.e. for most messages with low-to-medium logging rates.In this situation the enqueueing of a message is also not lock free, as while futexes can in theory be lock-free, the JVM uses a lock to synchronise access to the semaphore that controls its runnable state, so all threads attempting to wake it up concurrently will compete for this lock.
On 22 May 2016 at 14:42, Remko Popma <remko...@gmail.com> wrote:
On Sunday, May 22, 2016 at 6:34:13 PM UTC+9, Benedict Elliott Smith wrote:Hi Remko,I realise that I was looking at the old log4j code without realising it, in which there is always a futex involved.Which class is this? Async Loggers in Log4j 2 have always been lock-free. What may be confusing is that Log4j 2 also has an AsyncAppender, which does not use the Disruptor but uses a JDK BlockingArrayQueue. This appender is very similar to how Logback and Log4j 1 do asynchronous logging. AsyncAppender (in Log4j 2, Log4j 1 and Logback, they all use a blocking queue) is sensitive to lock contention and does not scale with more threads.However the behaviour of the disruptor that backs the new code will depend on the wait strategy employed (and I'll note your default is a blocking strategy, for which my prior statement holds*).Perhaps the key misunderstanding is here. I think I did not explain it well in my previous message. Let me try again.Async Loggers use the Disruptor and are lock-free. This means that multiple application threads can log concurrently and are not blocked by each other. This is true for very low workloads, medium workloads and high workloads.
Only if an application logs messages at a very high rate for a long period of time, or uses a slow appender, the Disruptor ringbuffer can fill up and application threads will have to wait until a slot in the ringbuffer becomes available. For the 2.6 release I have added text to the Trade-offs section to explain this last point, based on your feedback.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
It's possible I'm missing some other aspect that insulates the application thread from the disruptor, but from your message it seems to me that you fall into the all-too-common category of people who do not fully understand the semantics of the disruptor. Application threads (i.e. disruptor producers) very much are affected by the wait strategy. Under normal use, if the disruptor consumer thread is employing a blocking strategy, there will be futex call to unblock it when work is provided. i.e. whenever the queue transitions from empty to non-empty, i.e. for most messages with low-to-medium logging rates.In this situation the enqueueing of a message is also not lock free, as while futexes can in theory be lock-free, the JVM uses a lock to synchronise access to the semaphore that controls its runnable state, so all threads attempting to wake it up concurrently will compete for this lock.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
Your pride should be saved by your gracious recognition of the error :)
However this is the core of my point: you’re clearly an intelligent, conscientious and talented developer, and yet you did not fully understand these concerns. You are writing core infrastructure many people will deploy, and a majority will understand it much much less well. So the very best thing you can do is to educate them. Doubly so if you needed educating yourself!
I would make it very clear that users should only consider asynchronous logging if they are having performance problems caused by their logging. Only with sub-millisecond latency requirements should async be considered, and below 100 micros you are entering busy-spinning territory. Or if huge message rates are being seen. The best default is a blocking strategy, as this has the closest performance profile to synchronous, and will prevent the many users who deploy this without needing it from suffering any major ill-effect.
I would also do a performance comparison with a real application. Cassandra uses log4j, and the community has an easily utilised performance tool. You could try both DEBUG and INFO level, and put up some graphs. This would help users make a more realistic and informed decision.
This may all seem a little disappointing: to reduce the number of people who might use your amazing new technology. But there will be plenty, who both need it and do not and don't read or heed the warnings.
Regarding improvements: In my opinion, a better algorithm for this majority, of low-to-moderate traffic that is not extremely latency sensitive, is semi-synchronous. By which I mean for the first log call in a batch to take exclusive ownership of the output and to write its message synchronously; any messages that arrive while it has ownership are passed to the owner to persist, i.e. they are written asynchronously. To ensure any thread’s ownership is brief, it would impose a time-limit, after which a dedicated consumer could be started if the queue is still not exhausted. This would have better than synchronous behaviour for low-to-moderate traffic and scale gracefully to high traffic.
It's possible I'm missing some other aspect that insulates the application thread from the disruptor, but from your message it seems to me that you fall into the all-too-common category of people who do not fully understand the semantics of the disruptor. Application threads (i.e. disruptor producers) very much are affected by the wait strategy. Under normal use, if the disruptor consumer thread is employing a blocking strategy, there will be futex call to unblock it when work is provided. i.e. whenever the queue transitions from empty to non-empty, i.e. for most messages with low-to-medium logging rates.In this situation the enqueueing of a message is also not lock free, as while futexes can in theory be lock-free, the JVM uses a lock to synchronise access to the semaphore that controls its runnable state, so all threads attempting to wake it up concurrently will compete for this lock.
I don't mean to pretend that the normal approach is universally better - the graphs and lengthy write-up of the benefits clearly demarcate the opposite. I'm trying to make sure there is a balanced case presented, as everyone's excitement for async will no doubt imbalance the reading of even a balanced presentation.Really all I'm campaigning for is better education. I made all the same mistakes as we're discussing here, not long ahead of the curve. It pains me to see the entire developer community stumbling through the same errors independently.
--
Your pride should be saved by your gracious recognition of the error :)
However this is the core of my point: you’re clearly an intelligent, conscientious and talented developer, and yet you did not fully understand these concerns. You are writing core infrastructure many people will deploy, and a majority will understand it much much less well. So the very best thing you can do is to educate them. Doubly so if you needed educating yourself!
I would make it very clear that users should only consider asynchronous logging if they are having performance problems caused by their logging. Only with sub-millisecond latency requirements should async be considered, and below 100 micros you are entering busy-spinning territory. Or if huge message rates are being seen. The best default is a blocking strategy, as this has the closest performance profile to synchronous, and will prevent the many users who deploy this without needing it from suffering any major ill-effect.
I would also do a performance comparison with a real application. Cassandra uses log4j, and the community has an easily utilised performance tool. You could try both DEBUG and INFO level, and put up some graphs. This would help users make a more realistic and informed decision.
This may all seem a little disappointing: to reduce the number of people who might use your amazing new technology. But there will be plenty, who both need it and do not and don't read or heed the warnings.
Regarding improvements: In my opinion, a better algorithm for this majority, of low-to-moderate traffic that is not extremely latency sensitive, is semi-synchronous. By which I mean for the first log call in a batch to take exclusive ownership of the output and to write its message synchronously; any messages that arrive while it has ownership are passed to the owner to persist, i.e. they are written asynchronously. To ensure any thread’s ownership is brief, it would impose a time-limit, after which a dedicated consumer could be started if the queue is still not exhausted. This would have better than synchronous behaviour for low-to-moderate traffic and scale gracefully to high traffic.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-...@logging.apache.org
For additional commands, e-mail: log4j-d...@logging.apache.org
On Sunday, May 22, 2016 at 6:34:13 PM UTC+9, Benedict Elliott Smith wrote:Hi Remko,I realise that I was looking at the old log4j code without realising it, in which there is always a futex involved.Which class is this? Async Loggers in Log4j 2 have always been lock-free. What may be confusing is that Log4j 2 also has an AsyncAppender, which does not use the Disruptor but uses a JDK BlockingArrayQueue. This appender is very similar to how Logback and Log4j 1 do asynchronous logging. AsyncAppender (in Log4j 2, Log4j 1 and Logback, they all use a blocking queue) is sensitive to lock contention and does not scale with more threads.However the behaviour of the disruptor that backs the new code will depend on the wait strategy employed (and I'll note your default is a blocking strategy, for which my prior statement holds*).Perhaps the key misunderstanding is here. I think I did not explain it well in my previous message. Let me try again.Async Loggers use the Disruptor and are lock-free. This means that multiple application threads can log concurrently and are not blocked by each other. This is true for very low workloads, medium workloads and high workloads.
Only if an application logs messages at a very high rate for a long period of time, or uses a slow appender, the Disruptor ringbuffer can fill up and application threads will have to wait until a slot in the ringbuffer becomes available. For the 2.6 release I have added text to the Trade-offs section to explain this last point, based on your feedback.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-...@logging.apache.org
For additional commands, e-mail: log4j-d...@logging.apache.org
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-...@logging.apache.org
For additional commands, e-mail: log4j-d...@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-...@logging.apache.org
For additional commands, e-mail: log4j-d...@logging.apache.org
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
All the PrintStream.write() methods have locks.
--Matt Sicker <boa...@gmail.com>
But "response time pauses" are only an issue if you are latency sensitive, which was one of my explicit criteria. Most users aren't latency sensitive.Holding a lock is not inherently expensive; in fact it is very cheap on the scale of things we are discussing. What is expensive is interacting with the scheduler, and "writing to an IO device" (typically just writing to the page cache, so actually not very expensive - again, unless you care about outlier latency). In one situation you do just one of these things; in the other you do both. The synchronous behaviour is worse if the lock is highly contended, but that is one of the other criteria: there is a performance/throughput bottleneck in the logging calls. The semi-synchronous behaviour would avoid this situation, leaving only latency sensitivity.
NB: There is another possible criteria not mentioned, of course: Having spare cores, and the logging work being more expensive than the scheduler interaction. I've not benchmarked log4j, but I'm pretty sure this is not the case for anything resembling a typical log message.The "LiteBlockingWaitStrategy" does not address this. In the majority of situations (i.e. a log message rate of < 1-10/ms, as a very rough bound) its behaviour would be extremely similar to any other blocking wait strategy, since at this rate you would on average expect only about one unpark to be inflight at once - with all the usual caveats of depending on overall system load etc etc.
Semi-synchronous is simply a producer transitioning to a consumer to process its own message, as waking up the consumer is costlier than doing so. When it finds work piling up, it decides the cost of waking up the consumer is no longer negative, and does so.I will also note that for most users these extra costs aren't particularly material either; as soon as your log rate goes down to < 0.1/ms, the extra costs start to become very small as a proportion of total work. So there's definitely no reason to panic. But these users are still not deriving the advertised benefits from async.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
Could we avoid that by using FileDescriptor.out / FileDescriptor.err instead of System.out / System.err ?
On Tue, May 24, 2016 at 4:09 PM, Matt Sicker <boa...@gmail.com> wrote:
All the PrintStream.write() methods have locks.
On 24 May 2016 at 02:56, Mikael Ståldal <mikael....@magine.com> wrote:
Do we know why Console has so bad performance (compared to File)? Is this true also if you redirect STDOUT to a file?
and a preview of the updated performance page is here: http://home.apache.org/~rpopma/log4j/2.6/performance.html
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
Could we avoid that by using FileDescriptor.out / FileDescriptor.err instead of System.out / System.err ?On Tue, May 24, 2016 at 4:09 PM, Matt Sicker <boa...@gmail.com> wrote:All the PrintStream.write() methods have locks.On 24 May 2016 at 02:56, Mikael Ståldal <mikael....@magine.com> wrote:Do we know why Console has so bad performance (compared to File)? Is this true also if you redirect STDOUT to a file?
I understood your previous messages to mean that your argument against async logging is that the producer thread needs to take a lock to wake up the consumer thread
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
There is a "major" downside for some users - as an example, imagine a user with a single core server that performs a high rate of logging, and does so once every 100us. This user is interested in throughput only. There is reasonable chance of a material slow down with an async appender. Perhaps as much as 10%; or more, dependent on kernel, vm, core count, core affinity and way in which the runnable status is transitioned - for old paravirtualised boxes running old linux kernels, we could be talking a much worse degradation.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
As an additional anecdote, we had issues with ScyllaDB incurring
higher latencies under low loads, and had to patch seastar to
prevent this.
As an additional anecdote, we had issues with ScyllaDB incurring higher latencies under low loads, and had to patch seastar to prevent this.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-...@logging.apache.org
For additional commands, e-mail: log4j-d...@logging.apache.org
On May 25, 2016, at 4:18 PM, Mikael Ståldal <mikael....@magine.com> wrote:There are use cases for logging to standard out/err and redirecting to a file or something else than an actual console. It would be good if we would optimize so that is not 50x slower than logging directly to file.
On Wednesday, May 25, 2016 at 4:19:19 PM UTC+9, Avi Kivity wrote:As an additional anecdote, we had issues with ScyllaDB incurring higher latencies under low loads, and had to patch seastar to prevent this.
Can you explain a bit more about what caused this and how you resolved it?
--
Plus there's the fact that some people are encouraging all logging to happen to stdout (in containers) for simpler log configuration and handling. It would be nice if we can support that scenario better.
--Matt Sicker <boa...@gmail.com>
On May 26, 2016, at 9:41 AM, Mikael Ståldal <mikael....@magine.com> wrote:
On May 26, 2016, at 3:47 PM, Remko Popma <remko...@gmail.com> wrote:Kirk,Logging in binary format has been on my todo list for a while.
Hi Remko,A simple way to start is just let me send in a byte buffer instead of a string.
Then don’t touch the byte buffer just drop it to disk.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
Hi all,First, my thanks to the many people who gave helpful advice and feedback on how to measure Log4j response time on this list some time ago.We're about to start the Log4j 2.6 release.If anyone is interested, a preview of the garbage-free logging manual page is here: http://home.apache.org/~rpopma/log4j/2.6/manual/garbagefree.htmland a preview of the updated performance page is here: http://home.apache.org/~rpopma/log4j/2.6/performance.html
package org.apache.logging.log4j.util;
public interface StringBuilderFormattable {
/**
* Writes a text representation of this object into the specified {@code StringBuilder},
* ideally without allocating temporary objects.
*
* @param buffer the StringBuilder to write into
*/
void formatTo(StringBuilder buffer);
}
Cheers
Philippe
CheersPhilippe
Hi Remko
Great job !As Martin said, it's really a good thing for the high-performance community that someone is trying to improve existing logging frameworks.The company I'm working for even started to write it's own custom SLF4J implementation, and now we are evaluating if it's better for us to finish this internal project or to write some custom filters and switch to log4j.
I think there is one possible improvement with boxed primitive types: for the moment we want to use only SLF4J api (as a consequence, we're aiming for a low allocation rate, but not necessarily no allocation at all), so the "Unboxer" mecanism provided in log4j is not an option for us to deal with primitive types.Is this possible in a future release to have a special cases in ParameterFormatter.appendSpecialTypes() for boxed primitive types ? Currently, when using parametrized message with both Object and primitive parameters, I haven't find a "SLF4J-compatible" way to avoid this allocation when formatting.
private static boolean appendSpecialTypes(final Object o, final StringBuilder str) {
...
} else if (o instanceof Long) {
str.append(((Long) o).longValue());
return true;} else if (o instanceof Integer) {return true;
str.append(((Integer) o).intValue());
} else if (o instanceof Double) {
str.append(((Double) o).doubleValue());
return true;
} // similarly for float, short and boolean.
...
}
Kind Regards,Anthony
Would you like to hear my totally unbiased opinion/advice? :-)I'm not a fan of SLF4J... It means you can never use the rich feature set of the underlying logger. Like no lambdas! No CharSequences or plain domain objects, only Strings.Not sure why people would want to use it in enterprise software.Maybe, well, likely, I'm biased :-) but I honestly don't see the advantage.If the concern is the ability to change your mind later, there is always the log4j-to-slf4j adapter...
If I understand correctly, you're less concerned with the varargs and the auto-boxed primitives, but would like to avoid calling toString() on the objects that resulted from the auto-boxing (please correct me if I misunderstood). Is something like the below what you have in mind? Would you mind raising a feature request on the Log4j2 issue tracker for this?private static boolean appendSpecialTypes(final Object o, final StringBuilder str) {...
} else if (o instanceof Long) {
str.append(((Long) o).longValue());
return true;} else if (o instanceof Integer) {return true;
str.append(((Integer) o).intValue());} else if (o instanceof Double) {
str.append(((Double) o).doubleValue());return true;
} // similarly for float, short and boolean.
...}
Hi Remko,A simple way to start is just let me send in a byte buffer instead of a string. Then don’t touch the byte buffer just drop it to disk. It’s up to me to be able to read it though if people want eye readable then an implementation of more or less that can take hints from a schema to read the binary file would be helpful. The first one of these I wrote was in Smalltalk. The data was serialized into a block that I could send a message to and the whole thing inflated it’s self. Made managing tooling around schema versioning much much easier. For it to work this way you have to keep the schema with the data. Or you’ll have to some how manage schema’s. To be honest this is a problem that I push out of the framework into the supporting tooling. That requires some forethought by developers. But quite honestly I find that things tend to go much better when developers think about logging rather than just log.
Regards,Kirk
On May 26, 2016, at 3:47 PM, Remko Popma <remko...@gmail.com> wrote:
Kirk,Logging in binary format has been on my todo list for a while.We did some preliminary analysis here: https://issues.apache.org/jira/browse/LOG4J2-1305Your thoughts on this effort would be much appreciated.Remko
On Thursday, May 26, 2016 at 5:32:27 PM UTC+9, Kirk Pepperdine wrote:Hi,Sorry this might read a bit provocative then intended. In general I applaud this effort and to be fair I’ve not only picked on Log4J in the past. IM(not so)HO, all logger and in particular JDK logging has been a disaster from both an API and underlying design POV.On May 26, 2016, at 9:41 AM, Mikael Ståldal <mikael....@magine.com> wrote:I actually see little wrong with this approach. It is rare that I run into an application that isn’t bottlenecked on logging when you combine all of the problem that come from logging. The JDK logger, because of it’s design, is responsible for class loader leaks. The API’s in all loggers encourage programming styles that are responsible for excessive memory pressure. Though I gripe about the obscene amount of work that logging frameworks engage in, generally it’s not the logging framework that is directly responsible for memory pressure, it’s what has to be done to use the logging framework that is the source of the problem.To tackle this I’ve been pushing simple solutions such that the one pushed here. Loggers should only push messages directly to a sync point and do no more than that. Anything that injects extra work into a threads workflow should be discarded. This includes activities such as decorating and/or reformatting running through appenders.. and so on.... Even record ordering (if it needs to be done) should happen else where. Additionally, I give the ( very unpopular) advice) that logging should use binary/machine readable formats (a practice adopted by Twitter and a number of other players) in favor of eye readable formats (which tend to be neither human nor machine readable). In messaging, of which logging is a form of messaging, information density counts and human readable formats tend to be exceptionally information sparse. When you combine these techniques you can get tremendous (orders of magnitude) improvements in performance. As much as I’m a fan of the disruptor, I fail to see how building on top of it solves any of the above mentioned problems.Kind regards,Kirk--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.