--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/9lzzZ5Ns9pk/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to vertx+un...@googlegroups.com.
Hey Tim,
It's true that you eventually have to flush the log events to the disk, but the difference between sync and async logging is the average time per log event is much lower with async because the disk writes can be batched.
By default JUL logging is used. This can be configured using the file $VERTX_HOME\conf\logging.properties. Where VERTX_HOME is the directory in which you installed Vert.x.
From http://vertx.io/manual.html#logging :So I was under the wrong(?) impression that the default was standard and very slow java logging. It does seem to be using standard java logging for me here, or at least the debugger I'm using is tracing through those classes... If that is the default, I think it should be changed to log4j2 because that's probably what most people want without realizing it.
By default JUL logging is used. This can be configured using the file
$VERTX_HOME\conf\logging.properties. WhereVERTX_HOMEis the directory in which you installed Vert.x.
Hey Norman,
sure of course, we already did that, it was more a general question concerning logging and performance.
Perhaps this is well known, but I'll mention it because I've seen it happen many times: �Make sure your logging statements use as little resources as possible. � Eg
� �logger.debug("this is bad news" + objectWithAnExpensiveToString);
as is
� �logger.debug("this is bad news : %s ", expensiveComputation());
what you probably should do - especially around expensive debugs or any hotspots/performance bottlenecks parts of your code
�if (logger.isDebugEnabled()) logger.debug("heeeeey, relax - this is an unloaded dev machine " + generateSomeBitcoins());
and in general always use the string format (logger.debug("value is %d",value); ) and never string concat logger.debug("hey" + thing) since AFAIK, the JVM cannot optimize out the string concat before it invokes logger.debug.
Hope that is helpful,
Tom
On Tue, Jan 7, 2014 at 3:46 AM, Tim Fox <timv...@gmail.com> wrote:
I'd definitely recommend using log4j instead of JULOn 07/01/14 11:44, Sascha M�llering wrote:
Hey Norman,
sure of course, we already did that, it was more a general question concerning logging and performance.
Thx,
Sascha
Am Dienstag, 7. Januar 2014 12:42:16 UTC+1 schrieb Norman Maurer:
Hey Sascha,
Can�t you setup logging.properties to adjust the log level for it ?
--�
Norman Maurer
An 7. Januar 2014 at 12:40:47, Sascha M�llering (sascha.m...@gmail.com) schrieb:
It's our logging, well, kind of ... the Kafka-driver is logging like crazy.
Am Dienstag, 7. Januar 2014 12:37:08 UTC+1 schrieb Norman Maurer:
I wonder why the logging is affecting stuff so much� Are we logging so many things by default, I thought we only do when debug is set ?
--�
Norman Maurer
An 7. Januar 2014 at 11:37:17, Tim Fox (timv...@gmail.com) schrieb:
On 07/01/14 10:31, Ryan Chazen wrote:
From http://vertx.io/manual.html#logging :So I was under the wrong(?) impression that the default was standard and very slow java logging. It does seem to be using standard java logging for me here, or at least the debugger I'm using is tracing through those classes... If that is the default, I think it should be changed to log4j2 because that's probably what most people want without realizing it.
By default JUL logging is used. This can be configured using the file
$VERTX_HOME\conf\logging.properties. WhereVERTX_HOMEis the directory in which you installed Vert.x.
We could make log4j the default, the main (only?) reason why we don't is to keep the distro small and not introduce another jar dependency....
On Tue, Jan 7, 2014 at 12:24 PM, Tim Fox <timv...@gmail.com> wrote:
I don't really get it.. according to the docs for standard FileAppender http://logging.apache.org/log4j/2.x/manual/appenders.html it can be configured to buffer and not flush on each write. IIRC this is the default anyway, so this is effectively async *anyway*, so no idea why they need a specific async file appender (what's the difference?)
But in any case, the file appender that you chose with log4j, whether async or not, can be changed by just editing the log4j configuration, and don't see that anything needs to be done in Vert.x at all.
On 07/01/14 10:19, Ryan Chazen wrote:
While that's true, I recommend doing the following:Also, OutputStreamWriter.flush() is explicitly called on every log line...
Make a simple program and use a standard java logger to log out a couple lines. Put a breakpoint on one of the log lines and see just how much work each log line is doing. It literally does as much work as netty/vertx does in handling an http request...
On Tue, Jan 7, 2014 at 12:09 PM, Tim Fox <timv...@gmail.com> wrote:
AIUI they are batched anyway with most logging frameworks, it's only if you do an explicit flush will they be flushed to disk, and even then they are just written to the OS which by default (in most OS setups) just writes to a cache and flushes asynchronously anywayOn 07/01/14 09:55, Ryan Chazen wrote:
Hey Tim,
It's true that you eventually have to flush the log events to the disk, but the difference between sync and async logging is the average time per log event is much lower with async because the disk writes can be batched.
So I think there is a lot of benefit to be had from async logging in the same way we get benefit from async file writes...You can check out this table for the kind of speed difference between the async log4j2 and sync log4j2 handlers: http://logging.apache.org/log4j/2.x/images/async-vs-sync-throughput.png
On Tue, Jan 7, 2014 at 11:49 AM, Norman Maurer <norman...@googlemail.com> wrote:
I kind of like the idea.. I guess it would be even possible to implement a Logger that just forward the events over the eventbus and then a user could register for the events and handle them if needed.
--�
Norman Maurer
An 7. Januar 2014 at 10:36:31, Mumuney Abdlquadri (abdlq...@googlemail.com) schrieb:
I have not come across this. May be someone else will chime in.
But...
I guess you can create a separate module for logging specifically. Any
other module that needs logging will just send a message to the logger
module. So your main app will retain its performance. This is hacky I
know. Just a workaround.
On Tue, Jan 7, 2014 at 9:18 AM, Sascha M�llering
+1
On 07/01/14 14:27, Tom Carchrae wrote:
Perhaps this is well known, but I'll mention it because I've seen it happen many times: Make sure your logging statements use as little resources as possible. Eg
logger.debug("this is bad news" + objectWithAnExpensiveToString);
as is
logger.debug("this is bad news : %s ", expensiveComputation());
what you probably should do - especially around expensive debugs or any hotspots/performance bottlenecks parts of your code
if (logger.isDebugEnabled()) logger.debug("heeeeey, relax - this is an unloaded dev machine " + generateSomeBitcoins());
and in general always use the string format (logger.debug("value is %d",value); ) and never string concat logger.debug("hey" + thing) since AFAIK, the JVM cannot optimize out the string concat before it invokes logger.debug.
Hope that is helpful,
Tom
On Tue, Jan 7, 2014 at 3:46 AM, Tim Fox <timv...@gmail.com> wrote:
I'd definitely recommend using log4j instead of JULOn 07/01/14 11:44, Sascha Möllering wrote:
Hey Norman,
sure of course, we already did that, it was more a general question concerning logging and performance.
Thx,
Sascha
Am Dienstag, 7. Januar 2014 12:42:16 UTC+1 schrieb Norman Maurer:
Hey Sascha,
Can’t you setup logging.properties to adjust the log level for it ?
--
Norman Maurer
An 7. Januar 2014 at 12:40:47, Sascha Möllering (sascha.m...@gmail.com) schrieb:
It's our logging, well, kind of ... the Kafka-driver is logging like crazy.
Am Dienstag, 7. Januar 2014 12:37:08 UTC+1 schrieb Norman Maurer:
I wonder why the logging is affecting stuff so much… Are we logging so many things by default, I thought we only do when debug is set ?
--
Norman Maurer
An 7. Januar 2014 at 11:37:17, Tim Fox (timv...@gmail.com) schrieb:
On 07/01/14 10:31, Ryan Chazen wrote:
From http://vertx.io/manual.html#logging :So I was under the wrong(?) impression that the default was standard and very slow java logging. It does seem to be using standard java logging for me here, or at least the debugger I'm using is tracing through those classes... If that is the default, I think it should be changed to log4j2 because that's probably what most people want without realizing it.
By default JUL logging is used. This can be configured using the file
$VERTX_HOME\conf\logging.properties. WhereVERTX_HOMEis the directory in which you installed Vert.x.
We could make log4j the default, the main (only?) reason why we don't is to keep the distro small and not introduce another jar dependency....
On Tue, Jan 7, 2014 at 12:24 PM, Tim Fox <timv...@gmail.com> wrote:
I don't really get it.. according to the docs for standard FileAppender http://logging.apache.org/log4j/2.x/manual/appenders.html it can be configured to buffer and not flush on each write. IIRC this is the default anyway, so this is effectively async *anyway*, so no idea why they need a specific async file appender (what's the difference?)
But in any case, the file appender that you chose with log4j, whether async or not, can be changed by just editing the log4j configuration, and don't see that anything needs to be done in Vert.x at all.
On 07/01/14 10:19, Ryan Chazen wrote:
While that's true, I recommend doing the following:Also, OutputStreamWriter.flush() is explicitly called on every log line...
Make a simple program and use a standard java logger to log out a couple lines. Put a breakpoint on one of the log lines and see just how much work each log line is doing. It literally does as much work as netty/vertx does in handling an http request...
On Tue, Jan 7, 2014 at 12:09 PM, Tim Fox <timv...@gmail.com> wrote:
AIUI they are batched anyway with most logging frameworks, it's only if you do an explicit flush will they be flushed to disk, and even then they are just written to the OS which by default (in most OS setups) just writes to a cache and flushes asynchronously anywayOn 07/01/14 09:55, Ryan Chazen wrote:
Hey Tim,
It's true that you eventually have to flush the log events to the disk, but the difference between sync and async logging is the average time per log event is much lower with async because the disk writes can be batched.
So I think there is a lot of benefit to be had from async logging in the same way we get benefit from async file writes...You can check out this table for the kind of speed difference between the async log4j2 and sync log4j2 handlers: http://logging.apache.org/log4j/2.x/images/async-vs-sync-throughput.png
On Tue, Jan 7, 2014 at 11:49 AM, Norman Maurer <norman...@googlemail.com> wrote:
I kind of like the idea.. I guess it would be even possible to implement a Logger that just forward the events over the eventbus and then a user could register for the events and handle them if needed.
--
Norman Maurer
An 7. Januar 2014 at 10:36:31, Mumuney Abdlquadri (abdlq...@googlemail.com) schrieb:
I have not come across this. May be someone else will chime in.
But...
I guess you can create a separate module for logging specifically. Any
other module that needs logging will just send a message to the logger
module. So your main app will retain its performance. This is hacky I
know. Just a workaround.
On Tue, Jan 7, 2014 at 9:18 AM, Sascha Möllering
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.