Hi,
We’ve our DA server running on a dedicated for him machine (our DB is SQL Server 2008), having the flag PoolingEnabled = True, MaxPoolsize=100,PoolTimeoutSeconds=10, PoolTransactionBehaviour=ptRollback and PoolBehaviour=pbWait. While clients are requesting data, I see the columns “Handles” and “User Objects” on windows task manager increasing on every request and at the end, the “User Objects” ends up to 10000 and it hangs up. Before that we see a lot of memory leaks. We’ ve searched the code, but our objects are “killed” properly.
On the other hand, when I turn off the flag PoolingEnabled, the “Handles” and "User Objects"
are increasing on requests and then are released so the number is constant, but hangs up faster than when the flag is turned on.
Any suggestion? how can we play with the above properties?
I see the columns “Handles” and “User Objects” on windows task manager increasing on
every request and at the end, the “User Objects” ends up to 10000 and it hangs up.
What DA driver do you use? How many clients connect to the server at the same time?
how can we play with the above properties?
Here are descriptions of these properties:
MaxPoolSize:
Defines the maximum number of connections allows in the pool for each connection string. The
value of the PoolBehaviour property will control how the pools will behave
if the maximum number of connections is reached.
PoolBehaviour:
Manages the pool behavior when the maximum number of connections has been reached. The three available options include:
pbRaiseError - The call to NewConnection will fail with an exception.
pbWait - The call to NewConnection will wait until another connection is freed, and it will then return a connection.
pbIgnoreAndReturn - The call to NewConnection will return nil.
PoolingEnabled:
Enables connection pooling. Default is true. If enabled, the connection manager will maintain
a pool of reusable connections, to avoid the overhead of creating and destroying database
connections for each request. If disabled, each call to NewConnection will create a new
connection to the back-end database, which will be closed when it is released.
PoolTimeoutSeconds:
After this number seconds of inactivity old connections will be removed from the pool
and closed. Default is 60 seconds.
PoolTransactionBehaviour:
Decides how the pool handles connections that are returned to the pool with an
active transaction. The three available options include:
ptNone - No action will be taken.
ptRollback - The transaction will be rolled back, losing all changes (recommended).
ptCommit - The transaction will be committed, applying all changes to the underlying database.
ptCustom - The transaction will be handle via TDAConnectionManager.OnCustomPoolTransactionBehavior event.
I can confirm this scenario as well, although I didn’t know it was the pooling, but I have been having this problem at a client site whereby eventually (after 2 or three weeks running), the server stops responding to a client after reporting an “Out of memory” error.
On our client site we’re not using ADO (though we do elsewhere), we’re using anyDAC (to Informix via ODBC). I have a maxpoolsize of 1000. I also have something on my DA Service that checks the current poolsize of the connection manager and clears the pool if it is reached though I don’t know if it ever happens, i.e.:
procedure Txx.DataAbstractServiceBeforeAcquireConnection(
aSender: TObject; var aConnectionName: string);
var MaxPoolSize : integer;
begin
MaxPoolSize := Schema.ConnectionManager.MaxPoolSize;
if (Schema.ConnectionManager.PoolSize >= MaxPoolSize) then
Schema.ConnectionManager.ClearPool;
end;
I would be interested to hear any fixes, meanwhile I will investigate this further now I have somewhere to look.
Bill, which version of DA are you using? Have you updated to the latest, since I’ve noticed my server is running perfectly now, but a version from a month ago is showing this problem although I haven’t turned off the pooling to see if it fixes it (as I’ll need to revert my DA to rebuild).
After installing the new version, some things improved (responds faster, less memory leaks), but some other went too bad.
After shutting down DA Server raises AV (Eureka reported Stack overflow after destroying the application). Also the client application was raising AV’s also. We found out when filtering a TDAMemDataTable using “IN ()” with a large number of items (in our case we had 23 integer items, 1,2,3,7,13,14, …) some items were nil.
After shutting down DA Server raises AV (Eureka reported Stack overflow after destroying the application). Also the
client application was raising AV’s also. We found out when filtering a
TDAMemDataTable using “IN ()” with a large number of items (in our case we had 23 integer
items, 1,2,3,7,13,14, …) some items were nil.
Hello,
Can you send us a small testcase which reproduces this errors?
Do you use DynamicWhere feature for filtering? Do you test it with another driver?