How long an Azure' web role can stay active?
My cloud application (web role) uploads over 5000 records into SQL Azure. The total time for this process takes about 15-19 minutes on my development machine. Once, I deploy to the Cloud and try again, it fails after 10 - 12 minutes without any error message.
My g开发者_StackOverflow中文版uess is that the web role times out after certain period of time. Is there a setting for this?
Your webrole doesn't time out.
SQL Azure can time out and also your connection can be killed.
Some reasons for Connection Termination:
- Sessions consuming greater than one million locks are terminated.
- Transactions with a log file size > 1 GB are terminated.
- The distance from the first or oldest active transaction log sequence number (LSN) to the tail of the log (current LSN) cannot exceed 20% of the size of the log file.
- If a transaction locks a resource required by an underlying system operation for more than 20 seconds, it is terminated.
- When a session uses more than 5 GB of tempdb space (= 655,360 pages), the session is terminated.
- When there is memory contention, sessions consuming greater than 16-megabyte (MB) for more than 20 seconds are terminated in the descending order of time the resource has been held, such as the oldest session is terminated first.
- A database will be read-only when it reaches its maximum database size. Transactions attempting to updates or inserts will be terminated when this happens.
http://social.technet.microsoft.com/wiki/contents/articles/sql-azure-connection-management-in-sql-azure.aspx#Reasons
May I suggest you page your upload? Even if it's just to build the record set in memory (cache/queue/table/blob store rather) and then execute against SQL.
At the very least it'll allow you to isolate where the issue is.
精彩评论