c# - Multithreading application versus active sql session -
have c# application running multi-threaded (parallel.foreach
) 16 maximum concurrent threads. can see working fine because performance of execution time faster. however, wondering why showing less 16 active sessions on sql server monitor tool? bizarre part same application (similar set except using sql server 2012 instead of our sql sever 2008r2) running on our customer's machine, same tool report more 30 active session monitored. since can't access our customer's enviornment, wondering:
1. why there few active sessions found (usually less 5) on sql server while have 16 threads running concurrently?
2. why there more 30 active sessions reported on our customer machine? claim system isolated has our application access @ moment...
first 1 chart when running on environment:
vs chart when running on our customer's environment:
comment, , here trying provide more information:
i. confirmed application running single instance, , console desktop application.
ii. datawarehouse migration, download xml file server, , using same connection string on each thread (inside parallel.foreach , import data using nhibernate, part of code blackbox me since not familar nhibernate, call in-house dll carry out function)
iii. don't have information customer's machine knew have more powerful machine test server mine 16gb quadcore 64 bits win7. big difference using sql server 2012 , test server (who running application) sql 2008 r2 server (i.e. datawarehouse client db repository).
iv. understand each connection string should share 1 pool, have no clue why same monitor tool showing different number of sessions between me , customer's environment.
unless bad programmer code open , close database connections when needs them, using using construct.
and if tasks else read , write data means not keep connection open time.
which means naturally see less open connections - size of connection pool active. not reach sam e size of tasks because not used time.
Comments
Post a Comment