Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between command timeout and connection time out

Tags:

sql

asp.net

What is the difference between connection timeout and command timeout?

In our application sometimes it is showing a timeout error. When we increased the command timeout value to 100(from default 30), its working. Is there any issue in increasing the command timeout value.

Thanks,
Mahesh

like image 921
Mahesh KP Avatar asked Sep 09 '26 02:09

Mahesh KP


1 Answers

ConnectionTimeout is the time your code should wait when trying to open the connection to the DB

CommandTimeout is the time your code should wait for your SQL code to execute.

If you're hitting command timeout your SQL is taking a long time to execute, so you may want to check your query. If your query is optimized, then raising the command timeout may be the only thing to make your client work.

like image 183
Paolo Falabella Avatar answered Sep 10 '26 16:09

Paolo Falabella



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!