Subject Re: [IB-Architect] Server Threading Again
Author Dmitry Kuzmenko
Hello, Dmitry!

Dmitry Yemanov wrote:

> One more question about the server threading. Ibserver.exe spawns several
> threads for each database connection. Does all actual selects/inserts/etc
> within a connection belong to only one thread or a few ones? And in which
> situations does server switch threads during the query execution, if it does?

Experiments with IB 5.6 shows that:
1. at first there are as many threads, as newly connected users.
2. after some time threads count begin to shrink

I.e. if there were ~150 threads for 150 clients when server started,
after an hour there were ~50-70 threads per same 150 client connections.
All clients during test were busy executing one short query again and again
(without pauses).

Also some people found that threadvars in UDFs may have the same values
for different client connections.

I haven't looked sources to clear this issue, but I'm sure that
IB shares connection between threads. At least nobody refused this yet. :-)

> application (which calls special stored procedures after connect/before
> disconnect). This application hasn't been released to customers yet, but it
> works fine during the development. But will it always work? In all
> situations? I don't think it's a safe to use this trick, but there aren't
> essential variables in the engine yet and I couldn't find another way to do
> the same thing.

I suggest you to test this application with heavy load, I mean a lot of
concurrent connections.

> Could anyone comment this?

Dmitry Kuzmenko, Epsylon Technologies.
Welcome to (1251)