question

puneet.sh09 avatar image
puneet.sh09 asked

deadlock

i am developing a website where huge anount of users are loging and do the transactions. every transactions are under sql transactions. what is going on is that everyday 10 to 15 times deadlock uccures and cpu usage will go to 100% and website will go down. then we have to restart the iis. what will be the solution of this. can read_committed_snapshot isolation level will help
sql-server-2008-r2
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered
Deadlocks are primarily an artifact of poor performance. You're taking out locks on the system for too long. Or you're taking out too many locks because of scans. In general, the best solution to deadlocks is to tune your queries and configure your indexes in order to ensure maximum performance. You also need to worry about the order in which objects within the system are accessed by different queries. Those are your best tools for fixing deadlocks. And yes, using a snapshot isolation level can help because it will separate the locks needed for writes from the reads, but it's not a magic bullet. You'll still need to do the first thing which is tune your system.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ramesh 1 avatar image
ramesh 1 answered
yes it helps or else set the deadlock proioroty http://msdn.microsoft.com/en-us/library/ms186736.aspx check the link to change the deadlock prority
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.