[Introduction:]

Recently I worked on one project. The purpose of that project is sending emails according the business rules. So need lots of concurrent jobs then provide the enough scalability and throughput.

 

It's very interesting we found two solutions:

  1. CommJ pattern but be optimized from single-lane mode to multiple-lane mode it was designed by me.
  2. Kilim: Java version Actor, with coroutine support inside.

 

The kilim said they can work on the million concurrent jobs with minor memory and less thread support. How about the truth?

 

[Detail:]

Let's design one scenario:

The job contain the follwing steps:

1. Take map<string,string> as request

2. First get the value from the map<string,string> with the key value "KEY"

3. Second execute the subroutine with no parameter.

4. Third the subroutine will wait 200 ms and then return with string result with static value "executed".

 

ScenarioKilimMultiLane CommJ
  Concurrent 10000 Jobs

Memory consumption: 512M

Backend thread count: 160

Total execution time: 10072416187 ns

Memory consumption: 512M

Backend thread count: 160

Total execution time: 332489185 ns

  Concurrent 1000000 jobs

Memory consumption: 1024M

Backend thread count: 160

Total execution time: 1256589994539 ns

Memory consumption: 512M

Backend thread count: 160

Total execution time: 10244263167 ns

 

Note:

 

  • Lab env: 

       Computer: Dell Latitude E6400

       OS: Windows XP sp2

       Memory: 4G

       JDK: 1.6.1_22

  • Kilim exhaust memory a lot when the concurrent job count higher than some level.
  • MultiLane CommJ could handle million conncurrent jobs with minor memory and less threads.
  • MultiLane CommJ could handle concurrent jobs with almost linear scalability.
  • So Java could be very fast even in the very poor machine.

 

 

[References:]

1. Kilim: https://github.com/krestenkrab/kilim

2. CommJ: http://commonj.myfoo.de/ 

3. Mulilane introduce: http://www.1024cores.net/home/scalable-architecture/multilane

 

[Follow-up:]

I will open source the multi-lane version of commj. So please wait the future introduce.