Time Out Isssue

Hi,

We have a SQL Azure DB which is about 5 GB & whenever we try to execute an query which takes little more time to process it gives following error. Retrying also gives the same error. (Timeout occurs after executing query for about 5-10 mins )

- "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

Sample queries that gives the error (First one deletes old records & other for fragmentation):

-------------------------------------------------------------------------------------------------

DELETE [Table]                                  

where [Date] < DATEADD(d, -30, getdate())      

and

Environment in ('DEV','QA1','QA2', 'QA4','STG','') 

GO

-------------------------------------------------------------------------------------------------

DECLARE @TableName varchar(255)

  DECLARE TableCursor CURSOR FOR

 (

 SELECT '[' + IST.TABLE_SCHEMA + '].[' + IST.TABLE_NAME + ']' AS [TableName]

 FROM INFORMATION_SCHEMA.TABLES IST

 WHERE IST.TABLE_TYPE = 'BASE TABLE'

 )

  OPEN TableCursor

 FETCH NEXT FROM TableCursor INTO @TableName

 WHILE @@FETCH_STATUS = 0

  BEGIN

 PRINT('Rebuilding Indexes on ' + @TableName)

 Begin Try

 EXEC('ALTER INDEX ALL ON ' + @TableName + ' REBUILD with (ONLINE=ON)')

 End Try

 Begin Catch

 PRINT('Cannot do rebuild with Online=On option, taking table ' + @TableName+' down for douing rebuild')

 EXEC('ALTER INDEX ALL ON ' + @TableName + ' REBUILD')

 End Catch

 FETCH NEXT FROM TableCursor INTO @TableName

 END

  CLOSE TableCursor

 DEALLOCATE TableCursor

-------------------------------------------------------------------------------------------------

Is there anything that i can do to avoid this?



  • Edited by Threedor Wednesday, July 16, 2014 6:11 AM
July 16th, 2014 9:10am

Not sure but I think this is transient error. Did you try to implement retry login in it?

Here is the link to implement the Transient fault handling block in SQL Azure -

http://www.asp.net/aspnet/overview/developing-apps-with-windows-azure/building-real-world-cloud-apps-with-windows-azure/transient-fault-handling

If you are using SQL Azure with Entity framework then refer to the link -

http://sanganakauthority.blogspot.in/2014/07/transient-fault-handling-with-sql-azure.html 

Hope this helps.

Free Windows Admin Tool Kit Click here and download it now
July 16th, 2014 3:54pm

Hi Threedor,

According to your description and T-SQL statement, I do a test in my SQL Azure database, it can execute successfully. Based on your error message, we need to verify if the network is stability. If the Internet has been down, it always show timeout message when execute some queries. And we need to check if there is high numbers of outstanding requests within your SQL Azure database, for more information, see: http://social.technet.microsoft.com/wiki/contents/articles/1541.windows-azure-sql-database-connection-management.aspx#Throttling_Limits

In addition, another useful thing is that  we need to  do a deep database diagnostics, for example, we can check if there are expensive queries, connections are occurring within your database when the timeout error happens , there is an article about how to perform SQL Azure Performance & Diagnostics Analysis for SQL Azure.

Regards,
Sofiya Li

July 17th, 2014 6:31am

Are you using New Tier Basic ?

Try upgrade to Standard S1 Tier.

If it works, then it means you have to pay 4X (of basic) to run it.

B'cos you don't know when user will run it (it may be once in a month)

In non preview Tier system : Basic = 5$, Standard S1 = 20$

This is the price of running a query once a month :)

The basic Tier's processing is very slow.



  • Edited by angel0in 21 hours 24 minutes ago
Free Windows Admin Tool Kit Click here and download it now
July 24th, 2014 9:14am

Are you using New Tier Basic ?

Try upgrade to Standard S1 Tier.

If it works, then it means you have to pay 4X (of basic) to run it.

B'cos you don't know when user will run it (it may be once in a month)

In non preview Tier system : Basic = 5$, Standard S1 = 20$

This is the price of running a query once a month :)

The basic Tier's processing is very slow.



  • Edited by angel0in 21 hours 9 minutes ago
July 24th, 2014 9:18am

Are you using New Tier Basic ?

Try upgrade to Standard S1 Tier.

If it works, then it means you have to pay 4X (of basic) to run it.

B'cos you don't know when user will run it (it may be once in a month)

In non preview Tier system : Basic = 5$, Standard S1 = 20$

This is the price of running a query once a month :)

The basic Tier's processing is very slow.



  • Edited by angel0in Thursday, July 24, 2014 1:20 PM
Free Windows Admin Tool Kit Click here and download it now
July 24th, 2014 4:13pm

I just have a SQL Database in Azure, nothing else. I'm not so sure how this apply for a standalone SQl DB.

Thanks.
July 25th, 2014 2:41am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics