Java Berkeley DB DPL - read operation spikes

441 views Asked by At

I'm using DPL in Java. I have 1GB of data store. I'm firing 5 threads which are trying to read the same records after 1second of interval. Initially the read operation takes about 15ms for about 5-10 fetches and then stabilizes to 0ms (micro seconds) and then after 10-20 fetches it gives one spike in read operation (15ms).

what is the root cause of this and how to configure BDB to resolve it.

Thanks

1

There are 1 answers

0
Denis Bazhenov On

This easily could be garbage collector affecting performance of your application. Try to monitor GC cycles with following command:

jstat -gccause <pid-of-java-process> 200

and see is there any correlation between spikes and GC activity. Jstat provides following output:

100.00   0.00   5.63  86.19  60.53    768    4.165    16    0.796    4.960 unknown GCCause      No GC               
  0.00  96.01   0.00  87.15  60.53    769    4.172    16    0.796    4.967 unknown GCCause      No GC               
  0.00  96.01  82.86  87.15  60.54    770    4.172    16    0.796    4.967 unknown GCCause      Allocation Failure  
 75.27   0.00  69.29  87.15  60.54    770    4.175    16    0.796    4.971 unknown GCCause      No GC               
  0.00  94.75  16.33  87.30  60.56    771    4.179    16    0.796    4.975 unknown GCCause      No GC               
 41.07   0.00   0.00  87.69  60.59    772    4.184    16    0.796    4.980 unknown GCCause      No GC   

When you see Allocation failure this means full GC is started in cause of wanted memory.

Btw, jstat is part of JDK distribution, so it's must be installed.