Martin's mentioned a few times that he is planning on releasing a fast logging library soon. Any idea when that might be?We are switching from log4j and I'd love to take a look at Martin's lib.
--
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/groups/opt_out.
You might consider Java Chronicle.It can log text at a rate of between 100K to 1,000K lines per second (GC free)It can log binary entries at a rate well over one million per second (also GC free)It is *not* a drop in replacement for log4j though.Peter.
On 18 April 2013 18:09, <shah...@gmail.com> wrote:
Martin's mentioned a few times that he is planning on releasing a fast logging library soon. Any idea when that might be?We are switching from log4j and I'd love to take a look at Martin's lib.
--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
The cost of the lock is usually less than what the network IO, or a third party library will be doing to your system/latency.
On Friday, April 19, 2013 9:48:43 AM UTC+1, Peter Lawrey wrote:
The cost of the lock is usually less than what the network IO, or a third party library will be doing to your system/latency.
This is not always true. Without setting affinity I see the cost of a contended lock and associated context switch to be ~10us or greater on Linux. Can be down to ~3us on a well tuned system.
Now if you consider using 10GigE with kernel bypass libraries (Solarflare, Mellanox, or RoCE directly) the cost of a full network hop can be under 3us. If you are on a crappy older, or not well setup network, then the balance is greatly reversed.
I'm just illustrating this point because I know it is possible to write a multi-producer scenario that does not use locks and has other benefits. I believe a good logging framework should from the producers perspective be lock-free, wait-free, copy-free and garbage-free. Any logging approach that is greater than or equal to the cost of a network hop has a lot of room for improvement. An write to java.util.logging can cost 16us in the *uncontended* case which is unbelievable.I'm not knocking Chronicle which I think is a great library. I think it is at its best when used from a single threaded producer. Many applications have multiple producers requiring a shared logging infrastructure. Mechanical Sympathy for me is working in harmony with infrastructure to get the best out of it. I think as an industry we should talk more openly about what design patterns and infrastructure work best together.Martin...--
While I agree the numbers, it's not entirely fair to compare contented/non ideal latency of one thing with the best case numbers of another.In my experience, the worst case numbers of real networks tend to be higher than the worst case numbers of locking even if both are well engineered.
I would have thought a write to Java logging with dates and doubles etc can be much higher than 16 us esp as they create quite a bit of garbage. ;)
--
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-symp...@googlegroups.com.
Martin, you mentioned the a optimal logging framework from the producer's side would be lock-free, wait-free, copy-free, and garbage-free. Can you elaborate a bit on what the design might look like? One design that I've played around with is using disruptor as a message queue, and putting logging messages into disruptor for another thread to handle. However, this has the restriction that logging messages cannot contain reference to mutable objects, which involves first copying these objects somehow.
--
--
> A major benefit to using a shared memory buffer is that in the event of your process crashing the log is not lost. This is really important because the events recorded just before a crash are often the most useful to debugging that crash.
I suggest using Unsafe to check this is true. You can write a message and crash the JVM with Unsafe access to say address 0. This kills the whole JVM almost immediately (faster than pulling the power out of the machine) and no shutdown tasks are performed.BTW If you pull the power out of the machine this takes in the order of 0.016 seconds (at 60 Hz) to 0.1 seconds (with some capacitance) for the machine to die.
--
Would you be interested in having this be part of log4j? I don't know what API you have in mind, but log4j 2.0 is currently in beta, and changes are still possible. We'd love your input.
Respectfully,
Remko Popma
rpo...@apache.org
Remko,My views on what makes a good logging library are a very radical departure from the likes of log4j. I'm not saying log4j is wrong, it is just that it does not fit the requirements I see in the various clients I work with.Are you suggesting that with the new version you are considering moving away from static methods and logging strings as a standard API? I think the standard log4j API can be preserved and the performance greatly improved, however this API places serious limitations on performance, semantics, and testability.
My instincts are to produce a new journalling/logging library that meets the requirements of those at the high-end of performance without compromise. These folk are almost always rolling their own anyway. Then produce adapters/facades for the standard logging APIs for compatibility. This would allow a gradual migration of an existing code base and support the use of 3rd party libraries. A compromise solution will leave everyone equally dissatisfied.