Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scale SQL azure?

I want to host my WCF services in the Azure clouds for scalability reasons. For example there will be some read data action. And it will be under High Load (1000+ user/sec). (Like in my previous question)

Also I have a limitation in 1 sec timeout for any request.

My service will be connected with SQL Azure. I chosing it because of small latency (not more than 7ms according to microsoft's benchmark)

How many concurrent connections can hold SQL Azure per instance/database?

Is there any ability to scale SQL Azure when i will reach the limit of connections per instance?

Other solutions, options for my scenario?

Thanks.

like image 886
Kirill Avatar asked Feb 03 '23 17:02

Kirill


2 Answers

One thing to keep in mind is that you will need to make sure you are leveraging connection pooling to its maximum. Using a service account instead of different logins is an important step to ensure proper connection pooling.

Another consideration is the use of MARS. If you have many requests coming through, you may want to pool them together into a single request, hence a single connection, and return multiple resultsets. In this post I discuss how to implement one-way queuing of SQL statements; this may not work for you as-is because you may be expecting a response, but it may give you some ideas on how to implement a batch of requests to minimize the number of connections and minimize wait time.

Finally you can take a look at this tool I wrote last year to test connection/statements against SQL Azure. The tool automatically turns off connection pooling to measure the effects of concurrency. You can download it here.

Finally, I also wrote the Enzo Shard Library on codeplex. Let me know if you have any questions if you decide to investigate the library for your project. Note that the library will evolve to support the future capabilities of SQL Azure Data Federation as well.

like image 99
Herve Roggero Avatar answered Feb 28 '23 09:02

Herve Roggero


It appears there is no direct limit to the number of connections available per SQL Azure instance, but Microsoft state that they reserve the right to throttle connections in situations where resource use is regarded as "excessive".

There's some information on this here, also details on what may happen in this situation here.

A good work-around is to consider "sharding", where you partition your data on some easily-definable criteria and have multiple databases. This does, of course, incur additional cost. A neat implementation of that is here: http://enzosqlshard.codeplex.com/

Also: Azurescope have had some interesting benchmarks here: http://azurescope.cloudapp.net/BestPractices/#ed6a21ed-ad51-4b47-b69c-72de21776f6a (unfortunately, removed early 2012)

like image 44
Jeremy McGee Avatar answered Feb 28 '23 09:02

Jeremy McGee