Subject 60s delays on W2003 during data transfer (FB1.5 RC6)
Author remk_1
I noticed irregular 60 seconds delays during data transfer operations
on Windows 2003 server hosting FB 1.5 RC6. After some experiments I
was able to isolate the problem into small testing application. It
uses two independent database connections to one database. One to
read from "source" table, second to write to "destination" table.
Source connection executes SELECT * from source table, and for every
fetched row the destination connection inserts one row into
destination table by INSERT INTO statement. The database contains no
other tables and the tables contain just one integer column. The main
loop (written in Delphi using IBX components) looks like this:

...
SrcSQL.SQl.Add('SELECT * FROM SRCTAB');
SrcSQL.ExecQuery;
DstSQL.SQL.Add('INSERT INTO DSTTAB (ID) VALUES (:ID)');
...
RecNo:=0;
while not SrcSQL.Eof do
begin
...
DstSQL.Params[0].AsInteger:=RecNo;
DstSQL.ExecQuery;
SrcSQL.Next;
Inc(RecNo);
end;

The loop transfers 10000 rows, then it commits the data. The loop
is executed repeatedly, the destination table is cleaned after every
cycle.
Now, at random moments the application freezes after executing the
DstSQL.ExecQuery command for one minute. The delay's length is very
precise, it never takes less than 59 s or more than 60 s.

Here are some conditions that must be met to cause the delay
(fine-tuned to show the delay as soon as possible)
- client and server run on the same machine (using localhost loop)
- OS is Win 2003
- there are no other applications or clients attached to the DB
server during the test (any database activity instantly breaks the
delay)
- application opens two independent database connections. The
connections may or may not point to the same database. When I use
just one connection, the delay never occures.
- The probability of delay increases when I perform some UI activity
like moving application window, switching to another application and
back etc.

Some clues:
- DB server: FB 1.5 SS RC6 (also tested on previous versions, the
problem persists)
- Forced writes: enabled
- Connection type: TCP/IP local loop (localhost)
- DB file extension: FDB
- FB configuration file: default settings (no change)
- Processor: Pentium III 1266 Mhz (no HT, no SMP)
- Database size: 2 MB
- Test application is single threaded

I write this to show that there may be a problem with Win 2003 + FB
in applications which use more than one connection. Just interested
whether you have some experience or solution.

Regards,
Michal