February 24, 2012 at 2:20 am
Hi,
Are log sleeping/idle session good or bad?
Shall those be killed periodically? e.g. sys.dm_exec_sessions.last_request_start_time more than a certain period old then kill them.
What are the advantages and dis-advantages of keeping or killing such sessions?
Thanks.
February 24, 2012 at 2:24 am
i would say no.
if the connection count is getting higher and higher, its likely that one of the apps isnt closing and disposing of the connection object properly and leaving the connection open. another thing is, are the apps using connection pooling, if so it will leave connections open to reduce to load on SQL, as I have always been told, one of the most expensive things you can do is login.
February 24, 2012 at 6:07 am
here i am talking about user sessions and more specially sessions from SSMS, which people forgot to close and those remains there until they either close their SSMS OR restart the machine.
Thanks.
February 24, 2012 at 6:14 am
there is no issue with this I find, dev guys here usually leave SSMS open so as long as they dont execute a statement in a transaction and walk off for an hour, its not a problem.
if you want to close the connections, you could create a loop which goes through sysprocesses and terminates the connections based on last batch and the program name.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply