Jactor plus logback Vs log4j2

324 views
Skip to first unread message

champion

unread,
May 12, 2013, 9:19:10 PM5/12/13
to agilewikidevelopers
Hi,all
    I've just import the test code from http://logging.apache.org/log4j/2.x/manual/async.html#Location ,and run with logback appender with jactor,
The result are,Jactor win
         
Ranking:
1. Logback: Async jactor Appender (single thread): throughput: 5,276,365 ops/sec. latency(ns): avg=710.0 99% < 2048.0 99.99% < 32768.0 (24269433 samples)
2. Log4j2: Async Appender (single thread): throughput: 4,851,906 ops/sec. latency(ns): avg=798.2 99% < 2048.0 99.99% < 32768.0 (24691479 samples)
3. Logback: Async jactor Appender (2 threads): throughput: 1,814,211 ops/sec. latency(ns): avg=603.1 99% < 2048.0 99.99% < 21299.2 (49936431 samples)
4. Log4j2: Async Appender (2 threads): throughput: 1,405,864 ops/sec. latency(ns): avg=815.6 99% < 7782.4 99.99% < 65536.0 (49893335 samples)
5. Logback: Async jactor Appender (4 threads): throughput: 1,160,528 ops/sec. latency(ns): avg=933.7 99% < 1843.2 99.99% < 16384.0 (99998700 samples)
6. Log4j2: Async Appender (4 threads): throughput: 788,836 ops/sec. latency(ns): avg=901.9 99% < 8192.0 99.99% < 36864.0 (99998671 samples)
7. Logback: Async disruptor Appender (single thread): throughput: 95,263 ops/sec. latency(ns): avg=644.2 99% < 8192.0 99.99% < 235929.6 (915749 samples)
8. Logback: Async disruptor Appender (2 threads): throughput: 50,524 ops/sec. latency(ns): avg=1216.2 99% < 2048.0 99.99% < 871628.8 (11424246 samples)
9. Logback: Async disruptor Appender (4 threads): throughput: 27,310 ops/sec. latency(ns): avg=471.3 99% < 1177.6 99.99% < 22937.6 (23364184 samples)
 
 
The bad new is I have to add -XX:-UseGCOverheadLimit with 4 thread test,and JVM will run with 8 thread  java.lang.OutOfMemoryError: Java heap space 
Any advise?
 
org.apache.logging.log4j.core.async.perftest.PerfTestDriver.java             

champion

Vicky Kak

unread,
May 12, 2013, 11:38:37 PM5/12/13
to agilewiki...@googlegroups.com
>>java.lang.OutOfMemoryError: Java heap space


My guess right now would be the possible leak.
Have you profiled the application to see if there are any memory leaks?

Regards,
Vicky


--
You received this message because you are subscribed to the Google Groups "AgileWikiDevelopers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to agilewikidevelo...@googlegroups.com.
To post to this group, send email to agilewiki...@googlegroups.com.
Visit this group at http://groups.google.com/group/agilewikidevelopers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

champion

unread,
May 13, 2013, 12:05:37 AM5/13/13
to agilewikidevelopers
I do not think It's memory leaks,because 8 thread test will create 0.2  billion lines  log  lines,May be there are too actors.
Ok,In real project,there will not get so many logs,I think 4 thread test is enough
champion

monster

unread,
May 13, 2013, 6:02:36 AM5/13/13
to agilewiki...@googlegroups.com, champion
Firstly, thanks for the info. :)

Secondly, did you use JActor "1" or JActor "2"?

Now, for my advice. An OutOfMemoryError does not always mean there is no memory to be freed. It can also happen because it just didn't find the garbage within a reasonable amount of time. Lots of log message means lots of short-lived garbage objects. So you probably need to have much bigger young generation to get best GC performance. Just using JVisualVM with the additional profiler plugin ( you get asked if you want it on first start of JVisualVM, if I remember well) might be enough to show you where the problem is. If the young generation gets filled quicker then it can be cleaned, all temporary objects get promoted. And then you end-up with a deadly cycle where the JVM need to keep doing full GC to get rid of those short-lived objects; not good.

champion

unread,
May 13, 2013, 8:40:25 AM5/13/13
to agilewikidevelopers
I use jactor 1,Is jactor2 stable to use? I will try to use JvisualVM to find out error.
another info is jactor1 will use 100% cpu with 8 thread test on my computer (I7-2600.8 core)
 

champion

William la Forge

unread,
May 13, 2013, 8:51:00 AM5/13/13
to AgileWikiDevelopers
JActor2 is mostly stable, though it is not as fast as Jactor[1]. And it is still missing some of the speed enhancements. Like commandeering. --b

William la Forge

unread,
May 13, 2013, 9:24:40 AM5/13/13
to AgileWikiDevelopers
I would be remiss if I didn't say that the API of JActor2 is ever so much cleaner than JActor.

champion

unread,
May 13, 2013, 9:46:53 AM5/13/13
to agilewikidevelopers
OK,I will try jactor2 later
 

champion

Vicky Kak

unread,
May 13, 2013, 3:13:42 PM5/13/13
to agilewiki...@googlegroups.com
>>It can also happen because it just didn't find the garbage within a reasonable amount of time

This is interesting and did not expect this way, will check it tommorow.
Meanwhile if you have got some handy link validating this please pass across.

Regards,
Vicky


champion

unread,
May 25, 2013, 3:12:04 AM5/25/13
to agilewikidevelopers
I'm back,I think I found the reason of OutOfMemoryError.Just because slow I/O,there were too many JLPCActor waited in mailbox,and then old gen is full(with -Xmx1G),maybe I should slow the create of JLPCActor?
continue to create appender with jactor2.

champion

William la Forge

unread,
May 25, 2013, 3:51:19 AM5/25/13
to AgileWikiDevelopers
This is a problem with many actor systems--message flooding. Indeed, performance drops when you have a lot of unprocessed messages because gc runs slower when there are a lot of objects. JActor achieves high performance by providing mechanisms like call and send which have implicit flow control. Of course, there are always times when you need one-way messages, so signal is also supported. But if you are using signal a lot, then you run the risk of running with either a large memory footprint (and consequently slow gc) or periodic out of memory.

You can of course get around the inherent flow control by doing multiple calls or sends without waiting for response, and there are times when this is quite important. But you should limit the degree of parallelism as otherwise you are slowing things down and, in extreme cases, risking out of memory exceptions.

champion

unread,
May 25, 2013, 4:29:20 AM5/25/13
to agilewikidevelopers
You are right, Is there a signal  sample in jactor test?
 

champion

William la Forge

unread,
May 25, 2013, 4:41:46 AM5/25/13
to AgileWikiDevelopers
A quick search of Jactor2 shows 40 uses of Signal, but signal is what you should be avoiding if you need flow control.


--b
Reply all
Reply to author
Forward
0 new messages