SQL Azure - One session locking entire DB for Update and Insert

后端 未结 1 1128
孤城傲影
孤城傲影 2021-02-08 14:41

SQL Azure issue.

I\'ve got an issue that manifests as the following exception on our (asp.net) site:

Timeout expired. The timeout period elapsed prio

相关标签:
1条回答
  • 2021-02-08 15:04

    You might be running into the SE_REPL* issues that are currently plaguing a lot of folks using Sql Azure (my company included).

    When you experience the timeouts, try checking your wait requests for wait types of:

    • SE_REPL_SLOW_SECONDARY_THROTTLE
    • SE_REPL_COMMIT_ACK

    Run the following to check your wait types on current connections:

    SELECT TOP 10 r.session_id, r.plan_handle,
    r.sql_handle, r.request_id,
    r.start_time, r.status,
    r.command, r.database_id,
    r.user_id, r.wait_type,
    r.wait_time, r.last_wait_type,
    r.wait_resource, r.total_elapsed_time,
    r.cpu_time, r.transaction_isolation_level,
    r.row_count
    FROM sys.dm_exec_requests r
    

    You can also check a history of sorts for this by running:

    SELECT * FROM sys.dm_db_wait_stats
    ORDER BY wait_time_ms desc
    

    If you're seeing a lot of SE_REPL* wait types and these are staying set on your connections for any length of time, then basically you're screwed. Microsoft are aware of the problem, but I've had a support ticket open for a week with them now and they're still working on it apparently.

    The SE_REPL* waits happen when the Sql Azure replication slaves fall behind. Basically the whole db suspends queries while replication catches up :/

    So essentially the aspect that makes Sql Azure highly available is causing databases to become randomly unavailable. I'd laugh at the irony if it wasn't killing us.

    Have a look at this thread for details: http://social.technet.microsoft.com/Forums/en-US/ssdsgetstarted/thread/c3003a28-8beb-4860-85b2-03cf6d0312a8

    0 讨论(0)
提交回复
热议问题