Subject Re: [IBO] IB_Connection.Connect taking 6 hours
Author Carlos H. Cantu
Well, afair, GC can be started when:

- Sweep is triggered. If you have automated sweep enabled, maybe you
should consider disabling it and scheduling manual sweep at some hour
when the server is supposed to be idle (after midnight?). When you
open a DB with IBO, an internal transaction will be started, and this
may trigger automated sweep (if it is active for that DB).

- Something (like a select) reads a database page containing garbage.
In this case, on superserver, the transaction will inform the garbage
collection thread that there is garbage to be collected (this is
called background GC). In Classic, the transaction itself will clean
the garbage (this is called cooperative GC). There is also an hybrid
model.

There are several docs about GC on the internet. You may want to read
them to get more info.

[]s
Carlos H. Cantu
www.FireBase.com.br - www.firebirdnews.org
www.warmboot.com.br - blog.firebase.com.br

TG> Hello Carlos,

TG> thanks for the reply! I don't have access to the server so I can only
TG> see the delay in the logs, when it is already over.

TG> Yes maybe there were too many instances of the tool running in
TG> parallel. I will add more checkpoints inside of IBObjects to see where
TG> the hang occurs (for example loading the DLL or whatever).

TG> I don't have anything happening or triggered upon connection, so I
TG> guess I can assume that Firebird won't start garbage collection when
TG> opening a DB? It would do that later, correct?

TG> Cheers,
TG> Tobias

>> Did you use any monitoring tool to try to check what was going on with
>> the server?
>>
>> Ie: FBSCanner, Sinatica, etc.
>>
>> BTW, I never seem such big delay during connection. My first guess
>> would be system resources getting exhausted.
>>
>> You may want to try to identify if the delay was really to connect, or
>> was in some routine (or even connection trigger) doing something
>> *after* the connect already happened. For example, if a huge table had
>> all its records deleted, there can be a lot of garbage to be
>> collected, and GC can take really long time. The GC can be started
>> when some routine does a select in that table.
>>
>> []s
>> Carlos H. Cantu
>> www.FireBase.com.br - www.firebirdnews.org
>> www.warmboot.com.br - blog.firebase.com.br
>>
>> TG> Hello,
>>
>> TG> I didn't get any reply on the firebird-support list, so I am asking
>> TG> for help around here now!
>>
>> TG> I am using Firebird 2.5.0 Embedded with IBObjects.
>>
>> TG> One of my customers has a pretty extreme use case for my application.
>>
>> TG> The EXE is invoked maybe around 1000 times per day. Every time it opens
>> TG> and closes one of several Firebird databases. Several instances of the
>> TG> program can run in parallel, but each will use a separate database.
>>
>> TG> Maybe once in a few days, there is a delay opening the database.
>>
>> TG> For example, in one case, the command
>>
>> TG> IB_Connection.Connect;
>>
>> TG> took 6 hours. The database size in this case was 386MB and the main
>> TG> table contains 688654 rows.
>>
>> TG> What could cause such a delay and how can I avoid it?
>>
>> TG> Thanks for any tips.
>>
>> TG> Cheers,
>> TG> Tobias
>> TG> www.superflexible.com
>>
>>
>>
>>
>>
>> TG> ------------------------------------
>>
>> TG> ___________________________________________________________________________
>> TG> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
>> TG> without the need for BDE, ODBC or any other layer.
>> TG> ___________________________________________________________________________
>> TG> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>> TG> keyword-searchable FAQ, community code contributions and more ! Yahoo! Groups Links
>>
>>
>>



TG> ------------------------------------

TG> ___________________________________________________________________________
TG> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
TG> without the need for BDE, ODBC or any other layer.
TG> ___________________________________________________________________________
TG> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
TG> keyword-searchable FAQ, community code contributions and more ! Yahoo! Groups Links