Timeout - Doesn't timeout in time to prevent hanging

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Timeout - Doesn't timeout in time to prevent hanging

Post by mparak »

Dear Friends,
My application pings the server's IP address and connects when the server responds to the ping. This way I dont have to wait for connection to fail, which takes forever to respond.
When the server is unresponsive, I would like the connection to fail (quickly) so my application can know this and proceed to deal with the issue.
The TZconnection ignores the timeout=xx parameter and hangs the application. (when server is unresponsive).
Is there a way to get the failed connect, offline status of the server to return with an error (that is usable as an event) quick enough to prevent the client application from appearing to hang.? Please advise.

Regards

MParak
Durban.
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

Sound like this would be database specific. What database are you using?

Regards,

Ben
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Post by mparak »

We are using MySQL. (MySAM)
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

Shouldn't the parameter be 'connect_timeout' and should be set on the server itself.

Regards,

Ben
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Post by mparak »

Dear Ben,

[mysql]
connect_timeout=2


This sounds like a good option to help with half of the problem. Now that we can successfully timeout after failing to connect we need to timeout when a query takes too long to respond. How do we deal with a SQL script that takes longer than it should.?

Regards

M
Post Reply