linq to sql - SQL server Timeout – only happens very occasionally -
i have web application throw error….
exception message: timeout expired. timeout period elapsed prior completion of operation or server not responding.
when unable connect sql server, through management studio, it’s says server timed out , cannot connect.
as reset iis, comes instantly. means it’s in code that’s causing this. have mvc site uses linq sql , sql cache dependency service broker enabled.
i have used using statement thoroughly throughout code, im sure it’s not leaky connections. reading through server logs makes things more confusing there many information , warning events, im not sys admin it’s hard know what’s going on.
it begins me getting asp.net 4.xxxxx event id 1309 exception message: timeout expired. timeout period elapsed prior completion of operation or server not responding. error
i think got round last time on previous server restating iis when ever error popped up, don’t want resort on new server.
so question is, steps can take try , reduce ideally eliminate timeout error ?
any appreciated
truegilly
this type of problem boils down 1 of 2 things. either not disposing of connections or have number of heavy queries taking on database server.
if don't dispose of connections iis happily keep them around until garbage collection runs and/or timeout. if have lightly trafficked site won't see problem.
however, once traffic reaches point number of connections hanging around exceeds number of times trying make connection database server.. well, going start seeing 1 of couple possible errors. timeout expired one. exact error going depend on part falling over: connection pool, sql server itself, etc.
the fix commented on temporary solution. traffic continues increase (good problem have) other areas of code going cause issue come again.
Comments
Post a Comment