Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi Friends,

I am analyzing a piece of code for poor performance. The code is used to send a mail. It takes around 10 min to send 5 mails along with an attachment of approximately size 2MB.

When I analyzed this piece of code using SQL Profiler, in the trace file I find that Audit log out event keeps repeating in the trace. The Audit logout event is taking most of the time in the trace.

I searched for the solution,everyone explains what is Audit logout but nowhere I found a solution on how to remove this event in the trace so that performance of my code can improve a lot. Please help me.

TIA.
Posted

Hi,


Check this...

SQL Server Profiler Step by Step[^]

Hope this will help you.


Cheers
 
Share this answer
 
when opening a new profiling see the Events Selection tab and click it, here uncheck Audit Login and Audit Logout under Security Audit, next click run to begin.

Just on a note, not viewing the events in the profiler will not make them not happen or take any less time so whatever it will only affect the results displayed, to hide that information.
 
Share this answer
 
v2
Comments
Naveen K M 19-Aug-14 9:21am    
Thanks Thomas
My main purpose is to eliminate those events in the SQL profiler rather hiding them. It will improve the performance to a great extent.
Thomas Nielsen - getCore 20-Aug-14 4:38am    
You are very welcome Naveen. You cannot remove audits without reducing the number of connections. This means that in a situation for example where you have static class that keeps a connection open at all time, like for instance a connection factory which could then keep a pool of open connections at hand at all time and use those and keep some open and ready, and that part will not affect your performance.
Another solution which could be worth working with is increasing the 'max pool size' setting, making sure you connect with the same connection string all the time and remember to use the 'using' notation around connection strings if you're going for the pool size solution and ideally with the factory model also (as your dispose can be what gives it back to it's queue)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900