dbTalk Databases Forums  

Database gets constantly slower

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Database gets constantly slower in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
gerard.nicol@tapetrack.com
 
Posts: n/a

Default Database gets constantly slower - 10-11-2005 , 05:04 PM






I have an instance of my application that is running on Win2003 Server.
There are very few inserts, but some updates of fixed length keys and
records.

Over a period of a week the application goes from taking about 2
seconds to taking 10.

If I delete the DB Log files and reload the databases with a
db_dump/db_load the application then goes back to taking 2 seconds.

This does not seem to occur on other version of Windows, or Linux.

Any ideas?

Gerard

P.S. It would also be nice to have a db_reload utility that did the
db_dump/db_load in one safe application.


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Database gets constantly slower - 10-11-2005 , 10:34 PM






Hi Gerard,

Is it possible that your database file size is close to your cache
size? That would explain why small changes make a big difference to
performance, and also why a dump/load improves things (it will compact
the database so that it fits in cache again).

If that doesn't sound likely, can you tell where the time is being
spent? Is the system running at 100% CPU for those 10 seconds, or is
it I/O bound? Does switching off log flushing (with the DB_TXN_NOSYNC
flag to DB_ENV->set_flags) improve performance?

Quote:
P.S. It would also be nice to have a db_reload utility that did the
db_dump/db_load in one safe application.
This isn't something that applications should normally have to do.
There is a benefit of compacting the database, if keys were inserted
out-of-order, but that's usually an off-line operation. Also note that
db_load will use transactions if the environment is configured for
them, so it is safe in that sense.

The next release of Berkeley DB will have support for on-line
compaction, so that databases can be compacted without requiring a
dump/load.

Regards,
Michael.



Reply With Quote
  #3  
Old   
gerard.nicol@tapetrack.com
 
Posts: n/a

Default Re: Database gets constantly slower - 10-12-2005 , 05:32 PM



Michael,

Fixing the cache did the trick, it got it down from 20 seconds to 5.

Gerard


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.