database optimization

#1

Hi, couple of questions regarding database optimization:

1) Noticed something odd with the level 2 cache configuration:

   level2="0mb" -> 20 msec query

   level2="2mb" -> 10 msec

   level2="10mb" -> 40 msec

Question: why is a larger level2 cache worse than no level2 cache, ie 10mb worse than 0mb?

2) (separate issue) I'm noticing that write queries are around 20-50x slower than read queries, on the same set of objects.

 

 

 

#2

Memory management in Java is a complex topic and in some cases smaller cache might be slightly more efficient because keeping objects in memory for longer time has some overhead (e.g. when objects are moved from young to old generations by the Garbage Collector).

The best way to find the optimal configuration is by testing your application with different settings. But be careful in jumping to conclusions too early, measurement of milliseconds might be distorted because of many other reasons.

Read operations might be much faster because of using the cache (which is less effective in writing).

If you can post a simple test that demonstrates these observation this could be explored further.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login