Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 02-01-2007
Yunqiao Yin's Avatar
Yunqiao Yin Yunqiao Yin is offline
Registered User
 
Name: Yin Yunqiao
Organization: Baosteel
Project: real time process control system
 
Join Date: Jan 2004
Location: China
Posts: 56
Slow in Freeze Evictor add operation


We use Freeze Evictor manage our some permenent objects. Recently we found the evictor add() method become slower when actived objects in evictor increasing. The follow is the slowest codes in Freeze/EvictorI.cpp
Code:
Ice::ObjectPrx
Freeze::EvictorI::addFacet(const ObjectPtr& servant, const Identity& ident, const string& facet)
{
    ....
    //line:522
    EvictorElementPtr oldElt = store->putIfAbsent(ident, element); //sometimes very slow
    ....
At the same time a lot of log.0000xxxx files can be found in the evictor database enviroment. We have tried to increase the server thread pool size but no effect can be found.
Thanks for any reply!

Yours sincerely
YinYunqiao
__________________
Yunqiao Yin
Baosteel
real-time process control
ICE中文论坛http://lingdoo.just.as 欢迎大家捧场
Reply With Quote
  #2 (permalink)  
Old 02-01-2007
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 818
Hi Yin Yunqiao,

putIfAbsent is a fairly simple operation: it checks if an object with this identity is in the Evictor cache or in the database. If it is, the existing object is returned; otherwise, "element" is inserted in the cache.

In particular, this function does not write anything to the database, so it should not be slow.

One possibility is that you're adding (or changing) lots of objects; from time to time the evictor saves these changes to the database (in a background thread), and when this occurs various database pages are locked. This may block the database lookup performed by addFacet/putIfAbsent.

If that's the issue, you could save more often -- this way, each save would take less time and would not block lookups/reads for long.
For some applications, the solution could also be to save less. Say you're creating 1000 objects at start-up: the best strategy in this case could be to save every x minutes or when the number of modified objects reaches some value > 1000.

Now, the log files: these are transaction log files created by Berkeley DB. If you want perform backups of your database, you need to manage these log files carefully (back them up and delete them when they are no longer needed); see for example the Freeze/backup demo.

Otherwise, Freeze can delete them automatically with the configuration property:
Freeze.DbEnv.<env-name>.OldLogsAutoDelete=1
(the default is 1, so you don't need to set it)

If you have OldLogsAutoDelete set and the number of log files keeps increasing, then there is a bug.

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #3 (permalink)  
Old 02-06-2007
Yunqiao Yin's Avatar
Yunqiao Yin Yunqiao Yin is offline
Registered User
 
Name: Yin Yunqiao
Organization: Baosteel
Project: real time process control system
 
Join Date: Jan 2004
Location: China
Posts: 56
It works,thank you for your help!
__________________
Yunqiao Yin
Baosteel
real-time process control
ICE中文论坛http://lingdoo.just.as 欢迎大家捧场
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeze evictor synchronization with Java tie classes jdekozak Help Center 2 01-30-2007 02:12 PM
Is there any operation for slice2xxx to generate example servant code ? rc_hz Help Center 3 10-18-2006 11:24 AM
Freeze Evictor Transactions acbell Help Center 2 12-19-2005 12:43 PM
Identity Map for Freeze Evictor acbell Help Center 4 09-01-2005 04:27 PM
Fast track Freeze evictor for RDBMS StuartA Comments 0 05-23-2005 05:56 AM


All times are GMT -4. The time now is 11:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.