Multiple Simultaneous SQL Connection Timeouts In Multithreaded Windows Service

前端 未结 5 559
一生所求
一生所求 2020-12-25 12:37

I have a multithreaded Windows Service I\'ve developed with VS 2010 (.NET 4.0) which can have anywhere from a few to a few dozen threads, each retrieving data from a slow se

5条回答
  •  一整个雨季
    2020-12-25 12:53

    I get this every once in a while on this old database server that we have (coming up on 10 years old now). When it does happen though it's because something is hammering that thing with connections/queries constantly. My guess is that you'll find that when it happens the database server is under load (or a high number of connections or something along those lines) Anyway, in my experience if you can optimize the code, optimize the database, getting a beefier database server, etc. all helps. Another thing you can do, which Piotr suggests, is simply up the timeout for the connection. I'd still go through and optimize some stuff though (should help in the long run).

提交回复
热议问题