hi,
I'm using V4.65 with standard db-pool settings.
My problem is that the closing of my connections takes about 20-40 ms each time. If I execute multiple sql-queries within a too short time period (even from different pages) the closing can slow down up to 100-400ms for each close.
Could anyone help me with this? As I have some permanent db-requests (1-2 per second, 24/7) it slows down my whole application.
Thanx a lot
Connection close slows down on multiple requests
1. Are you using the dotConnect for PostgreSQL connection pooling implementation (the Pooling=true; connection string parameter) or any separate tool that creates and manages connection pool for your PostgreSQL server? Try setting Pooling=true/false in your connection string. Does it make any difference?
2. Can the delay be caused by your environment? Have you tried any other providers? Which results have you obtained?
3.
2. Can the delay be caused by your environment? Have you tried any other providers? Which results have you obtained?
3.
How much time does opening connection take in your environment?raposa wrote:closing of my connections takes about 20-40 ms each time
hi,
1) I'm using the dotConnect Pooling - if I deactive the pooling things get worse.
2) How can my environment cause the delay? The Application runs on a MS Server 2008 Standard Edition 32bit.
3) opening is pretty fast - it costs nothing.
Its just the closing, which takes so long. I check the connectionState bevore I close the connection but that can't take that long.
1) I'm using the dotConnect Pooling - if I deactive the pooling things get worse.
2) How can my environment cause the delay? The Application runs on a MS Server 2008 Standard Edition 32bit.
3) opening is pretty fast - it costs nothing.
Its just the closing, which takes so long. I check the connectionState bevore I close the connection but that can't take that long.
PgSqlConnection.Close() should work faster with "Pooling=false;". We cannot explain your results at the moment.raposa wrote:1) I'm using the dotConnect Pooling - if I deactive the pooling things get worse.
Please create console application and try this code:rapose wrote:2) How can my environment cause the delay? The Application runs on a MS Server 2008 Standard Edition 32bit.
3) opening is pretty fast - it costs nothing.
Code: Select all
using (PgSqlConnection conn = new PgSqlConnection()) {
conn.ConnectionString = "server=***;port=***;database=***;uid=***;pwd=***;schema=***;Pooling=true;";
DateTime dt;
for (int i = 0; i < 100; i++) {
conn.Open();
dt = DateTime.Now;
conn.Close();
Console.WriteLine(DateTime.Now - dt);
}
}
Console.ReadKey();