[infinispan-dev] Faster LRU

Dan Berindei dan.berindei at gmail.com
Fri Jul 8 05:44:37 EDT 2011


On Fri, Jul 8, 2011 at 2:53 AM, Dan Berindei <dan.berindei at gmail.com> wrote:
> I've updated pull #414
> (https://github.com/infinispan/infinispan/pull/414) to work on top of
> Vladimir's pull request, in case you want to have a look. You might
> want to adjust the number of keys and/or disable some of the options
> in the data providers before running it though, it takes a lot of time
> to run (and it also needs -Xmx2000m).
>
> I've left it running overnight on the test cluster (cluster01 and
> cluster10), I'll send an update with the results in the morning.
>


Morning update:
Ok, apparently -Xmx2000m wasn't enough for 2 million keys, so I had to
start the tests again in the morning, running each scenario on a
different machine.

I haven't run the tests with concurrency level 512, as the total
number of threads is only 100, but I suspect the old LRU still won't
catch up with the new LRU's performance.

It's interesting that in the writeOnMiss test the new LRU performance
dropped when I increased the concurrency level from 32 to 128. I think
it might be because the eviction.thresholdExpired() check in
BCHM.attemptEviction() is done without a lock and so it could return
true simultaneously for multiple threads - which will all proceed to
wait on the segment lock and attempt eviction at the same time.

Another strange pattern is that neither eviction policy respects the
capacity parameter exactly. LIRS rounds up the capacity to the next
power of 2, and LRU/LRUOld do the same rounding and then multiply by
0.75.

I'll report again once I fixed these and once I update the reporting -
I think the total number of misses might be more relevant than the
standard deviation of the keys at the end.

Cheers
Dan
-------------- next part --------------
Testing independent read/write/remove performance with 500000 max elements, 1000000 keys, 32 concurrency level, 90 readers, 9 writers, 1 removers
Container       BCHM:LIRS       Average get ops/s         17692.17      Average put ops/s          3871.06      Average remove ops/s       2043.00      Size        515661      stdDev   175722.99
Container       BCHM:LRU        Average get ops/s         36023.40      Average put ops/s          1084.62      Average remove ops/s       1131.47      Size        393216      stdDev   145373.51
Container       BCHM:LRU_OLD    Average get ops/s           849.86      Average put ops/s           273.88      Average remove ops/s        244.41      Size        398940      stdDev   154739.53
Container       CLHM    Average get ops/s         48761.40      Average put ops/s         47008.30      Average remove ops/s      49627.01      Size        500000      stdDev   187244.21
Container       SLHM    Average get ops/s         16866.18      Average put ops/s         23715.77      Average remove ops/s      15630.28      Size        500000      stdDev   178134.07
[testng-MapStressTest] Test testReadWriteRemove(org.infinispan.stress.MapStressTest) succeeded.
Test suite progress: tests succeeded: 1, failed: 0, skipped: 0.
Testing independent read/write/remove performance with 500000 max elements, 1000000 keys, 128 concurrency level, 90 readers, 9 writers, 1 removers
Container       BCHM:LIRS       Average get ops/s         18868.45      Average put ops/s          6599.76      Average remove ops/s       3316.55      Size        521216      stdDev   175810.97
Container       BCHM:LRU        Average get ops/s         32797.94      Average put ops/s          7976.01      Average remove ops/s       8463.70      Size        393113      stdDev   153926.63
Container       BCHM:LRU_OLD    Average get ops/s          4093.76      Average put ops/s          1675.52      Average remove ops/s       1335.27      Size        389083      stdDev   152948.92
Container       CLHM    Average get ops/s         68179.61      Average put ops/s         64678.23      Average remove ops/s      70212.72      Size        499968      stdDev   181346.12
Container       SLHM    Average get ops/s         17893.75      Average put ops/s         24506.01      Average remove ops/s      14617.09      Size        491341      stdDev   181870.67
[testng-MapStressTest] Test testReadWriteRemove(org.infinispan.stress.MapStressTest) succeeded.
Test suite progress: tests succeeded: 2, failed: 0, skipped: 0.


Testing combined read/write performance with 500000 max elements, 1000000 keys, 32 concurrency level, 100 threads, 9:1 read:write ratio
Container       BCHM:LIRS       Average ops/s     12903.45      Size        524258      stdDev   170614.40
Container       BCHM:LRU        Average ops/s     25041.20      Size        393216      stdDev   154386.88
Container       BCHM:LRU_OLD    Average ops/s       545.07      Size        393243      stdDev   156098.32
Container       CLHM    Average ops/s     45277.37      Size        500000      stdDev   169786.71
Container       SLHM    Average ops/s     17522.45      Size        500000      stdDev   171034.64
[testng-MapStressTest] Test testReadWrite(org.infinispan.stress.MapStressTest) succeeded.
Test suite progress: tests succeeded: 1, failed: 0, skipped: 0.
Testing combined read/write performance with 500000 max elements, 1000000 keys, 128 concurrency level, 100 threads, 9:1 read:write ratio
Container       BCHM:LIRS       Average ops/s     15806.67      Size        524159      stdDev   170553.67
Container       BCHM:LRU        Average ops/s     25378.25      Size        393216      stdDev   155259.94
Container       BCHM:LRU_OLD    Average ops/s      3579.77      Size        393351      stdDev   154624.81
Container       CLHM    Average ops/s     65053.74      Size        499968      stdDev   170873.72
Container       SLHM    Average ops/s     18164.84      Size        500000      stdDev   172053.61
[testng-MapStressTest] Test testReadWrite(org.infinispan.stress.MapStressTest) succeeded.
Test suite progress: tests succeeded: 2, failed: 0, skipped: 0.


Testing write on miss performance with 500000 max elements, 1000000 keys, 32 concurrency level, 100 threads
Container       BCHM:LIRS       Average ops/s     14935.33      Size        524259      stdDev   196821.96
Container       BCHM:LRU        Average ops/s     26388.85      Size        393216      stdDev   185915.00
Container       BCHM:LRU_OLD    Average ops/s       200.69      Size        393751      stdDev   188389.30
Container       CLHM    Average ops/s     30311.11      Size        500000      stdDev   192821.52
Container       SLHM    Average ops/s     13628.69      Size        500000      stdDev   192521.08
[testng-MapStressTest] Test testWriteOnMiss(org.infinispan.stress.MapStressTest) succeeded.
Test suite progress: tests succeeded: 1, failed: 0, skipped: 0.
Testing write on miss performance with 500000 max elements, 1000000 keys, 128 concurrency level, 100 threads
Container       BCHM:LIRS       Average ops/s     15233.78      Size        524160      stdDev   196413.65
Container       BCHM:LRU        Average ops/s     21226.93      Size        393216      stdDev   184607.80
Container       BCHM:LRU_OLD    Average ops/s      1964.23      Size        395134      stdDev   186816.89
Container       CLHM    Average ops/s     36630.53      Size        499968      stdDev   192561.41
Container       SLHM    Average ops/s     13536.66      Size        500000      stdDev   192738.19
[testng-MapStressTest] Test testWriteOnMiss(org.infinispan.stress.MapStressTest) succeeded.
Test suite progress: tests succeeded: 2, failed: 0, skipped: 0.


More information about the infinispan-dev mailing list