niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
· nixdoc.net · man pages · Linux HOWTOs · FreeBSD Tips · Forums
navigation Forum index » Databases » Berkeley DB
Problems during insert.
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
M4zi
*nix forums beginner


Joined: 28 Apr 2006
Posts: 1

PostPosted: Fri Apr 28, 2006 7:04 am    Post subject: Problems during insert. Reply with quote

Hallo everybody, i'm a newbie.

I'm trying to test Berkeley DB Java Edition to understand if is the
right technology for my purpose.

I'll try to explain what is the environment and what i'm testing.

The server is a hp server dual cpu with 4 GB of ram running linux os
(red hat distribution).

I got a multithread test, in which every thread has its own Berkeley
environment, with its own DB (around 6 PrimaryDb and other 2 Secondary
DB for environment)

Every thread running (200) got 2,5 MB of cache
....
environmentConfig.setCacheSize((5 * 1000 * 1024)/2));
....

and handles a lot of domain objects (around 20000 different objects) in
6 primaryDB and 2 secondaryDB.

The JVM maximum heap size is set to 1024 MB.

The problem that occurs sometimes is that when we monitor the server
with the top command during the creation and the insert in
DBEnvironment of our beans we got this strange behaviour:

CPU states:
cpu user nice system irq softirq iowait idle
total 2.7% 0.0% 97.2% 0.0% 0.0% 0.0% 0.0%

As you can see after vmstat command at a certain moment the system
(kernel) process goes at maximum load.

procs memory swap io system
cpu
r b swpd free buff cache si so bi bo in cs us
sy id wa
4 0 0 2652940 56556 552516 0 0 0 4324 217 995 78
3 20 0
7 1 0 2607224 57216 599432 0 0 0 5641 234 1017 85
2 13 0
108 0 0 2601400 57792 625236 0 0 0 3031 197 677 46
43 11 0
109 0 0 2601400 57812 625236 0 0 0 17 141 194 2
98 0 0
108 0 0 2601400 57836 625236 0 0 0 17 141 134 2
98 0 0

I was supposing to got a lot of disk work (iowait) and not this other
"kernel" work during the test.
Moreover this behaviour is not systematic and I cannot understand which
operation is guilty.
I think that cache size is not responsible because I can see that the
iowait is very low.

Moreover once happened this exception:

[java] 14:29:46;/var/berkeley/VM_0_120;722156;180114;52116
[java] <Checkpointer name="Checkpointer"/> caught exception:
com.sleepycat.je.DatabaseException: fetchTarget of 0x2/0x15cd50
IN=960004 state=0 com.sleepycat.je.log.LogFileNotFoundException:
0x2/0x15cd50 Couldn't open file /var/berkeley/VM_0_40/00000002.jdb:
/var/berkeley/VM_0_40/00000002.jdb (Too many open files)
[java] com.sleepycat.je.DatabaseException: fetchTarget of
0x2/0x15cd50 IN=960004 state=0
com.sleepycat.je.log.LogFileNotFoundException: 0x2/0x15cd50 Couldn't
open file /var/berkeley/VM_0_40/00000002.jdb:
/var/berkeley/VM_0_40/00000002.jdb (Too many open files)
[java] at com.sleepycat.je.tree.IN.fetchTarget(IN.java:922)
[java] at
com.sleepycat.je.tree.Tree.searchSubTreeUntilSplit(Tree.java:1994)
[java] at
com.sleepycat.je.tree.Tree.searchSubTreeSplitsAllowed(Tree.java:1933)
[java] at
com.sleepycat.je.tree.Tree.searchSplitsAllowed(Tree.java:1637)
[java] at
com.sleepycat.je.tree.Tree.findBinForInsert(Tree.java:3088)
[java] at com.sleepycat.je.tree.Tree.insert(Tree.java:2263)
[java] at
com.sleepycat.je.dbi.CursorImpl.putLN(CursorImpl.java:964)
[java] at
com.sleepycat.je.cleaner.UtilizationProfile.insertFileSummary(UtilizationProfile.java:1118)
[java] at
com.sleepycat.je.cleaner.UtilizationProfile.putFileSummary(UtilizationProfile.java:724)
[java] at
com.sleepycat.je.cleaner.UtilizationProfile.flushFileSummary(UtilizationProfile.java:664)
[java] at
com.sleepycat.je.recovery.Checkpointer.flushUtilizationInfo(Checkpointer.java:497)
[java] at
com.sleepycat.je.recovery.Checkpointer.doCheckpoint(Checkpointer.java:411)
[java] at
com.sleepycat.je.recovery.Checkpointer.onWakeup(Checkpointer.java:218)
[java] at
com.sleepycat.je.utilint.DaemonThread.run(DaemonThread.java:189)
[java] at java.lang.Thread.run(Thread.java:595)
[java] Continuing

Any idea of what is going on?

Thank you

Mazi
Back to top
mark@sleepycat.com
*nix forums beginner


Joined: 22 Aug 2005
Posts: 18

PostPosted: Mon May 01, 2006 8:13 pm    Post subject: Re: Problems during insert. Reply with quote

Hello Mazi,

Sorry for the slow reply, we don't normally use the newsgroup for the
JE product. In the future I suggest using the bdbje mailing list, see
here:

http://dev.sleepycat.com/community/discussion.html

Please see my comments below.

M4zi wrote:

Quote:
The server is a hp server dual cpu with 4 GB of ram running linux os
(red hat distribution).

I got a multithread test, in which every thread has its own Berkeley
environment, with its own DB (around 6 PrimaryDb and other 2 Secondary
DB for environment)

Every thread running (200) got 2,5 MB of cache

This is a very unusual configuration. Can you use a single environment
with a 250 MB cache, and split up your data by database? You will get
much better cache utilization with a single larger cache than with many
small caches.

Quote:
and handles a lot of domain objects (around 20000 different objects) in
6 primaryDB and 2 secondaryDB.

The JVM maximum heap size is set to 1024 MB.

I was supposing to got a lot of disk work (iowait) and not this other
"kernel" work during the test.
Moreover this behaviour is not systematic and I cannot understand which
operation is guilty.
I think that cache size is not responsible because I can see that the
iowait is very low.

I suspect that the cache size is the problem. Since you have 4 GB
physical memory, if it is not used by other processes then my guess is
that all of your database files are in the file system cache. Because
you are using a small JE cache size for each JE environment, the system
may be spending a lot of its time moving data between the JE cache and
the file system cache. This doesn't require real device I/O, but is
still doing a lot of work in the kernel to move data out of the file
system cache.

Please try increasing the size of the 200 caches to see if the behavior
changes. For example, double your Java heap size and use a 8 MB cache
for each environment. JE will then use 1.8 GB out of a 2 GB heap.

Or even better, use a single enviornment with a large cache. Doing
this, you can probably get away with a smaller cache -- perhaps a 750
MB cache in a 1 GB heap would suffice.

Another possibility is that you have too many threads active at the
same time, and the kernel is spending a lot of time switching between
threads. If you only have two CPUs, it is best to have a comparable
number of concurrent threads. I suggest limiting the number of active
concurrent threads to four or less, by using a thread pool.

Quote:
Moreover once happened this exception:

[java] 14:29:46;/var/berkeley/VM_0_120;722156;180114;52116
[java] <Checkpointer name="Checkpointer"/> caught exception:
com.sleepycat.je.DatabaseException: fetchTarget of 0x2/0x15cd50
IN=960004 state=0 com.sleepycat.je.log.LogFileNotFoundException:
0x2/0x15cd50 Couldn't open file /var/berkeley/VM_0_40/00000002.jdb:
/var/berkeley/VM_0_40/00000002.jdb (Too many open files)

The "Too many open files" in the error above is the clue. One solution
is to increase the maximum number of open files in your OS.

Or, you can reduce the size of JE's file handle cache. It is 100 by
default. For example, you can change it to 10 by putting this line in
your je.properties file (in your environment directory):

je.log.fileCacheSize=10

Even better, if you use a single environment instead of 200
environments, you'll reduce the number of open files by a factor of
200, and then you won't need to change the size of JE's file handle
cache.

Mark
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Sep 09, 2010 11:58 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts dovecot pop3 log in problems digibandit Postfix 0 Tue May 25, 2010 5:16 pm
No new posts Postfix - delivery problems bahadirtonguc Postfix 1 Wed Oct 28, 2009 9:57 pm
No new posts Problems with Postfix / Round-Robin pablos Postfix 0 Mon Feb 02, 2009 3:34 pm
No new posts Insert header and footer in every page served by proxy ehmedk Apache 0 Tue Apr 22, 2008 6:27 pm
No new posts Insert header and footer in every page served by squid ehmedk Squid 0 Tue Apr 22, 2008 6:16 pm

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum |  email marketing service
 
Sponsors: Debt Help | Bathroom Enclosures | Debt Help | Debt Help | Find jobs
Privacy Policy
[ Time: 0.6145s ][ Queries: 17 (0.5824s) ][ GZIP on - Debug on ]