1

Looking to optimize the performance of WCF Rest services hosted on Azure. The services retrieve data from SQL Azure tables and in some cases Azure table storage. They are all on public endpoints.

Question - In WebRole.cs I can see that ServicePointManager.DefaultConnectionLimit is set to 2. The instancecontext mode of all the services is PerCall. In this case would changing ServicePointManager.DefaultConnectionLimit to 12 make any difference in the performance?

user529265
  • 820
  • 10
  • 27

1 Answers1

2

This is a complex issue, and as I understand this also partly depend on:

  • CPU physical and logical attributes
  • Process model request queue limit
  • Process model maximum IO threads
  • Maximum concurrent requests per CPU
  • Maximum concurrent threads per CPU

I wont pretend to know much about it, I really don't. But I'm trying to understand how it works. From what I can gather I use this setup (I give absolutely no guarantees that this is the best setup):

RuntimeConfiguration.ProcessModelRequestQueueLimit = 5000 * Environment.ProcessorCount RuntimeConfiguration.ProcessModelMaxIoThreads = 100 * Environment.ProcessorCount HostingEnvironment.MaxConcurrentRequestsPerCPU = 5000 HostingEnvironment.MaxConcurrentThreadsPerCPU = 0 System.Net.ServicePointManager.DefaultConnectionLimit = Int32.MaxValue (well, I actually use only 48 here atm since it seems enough for my purpose and is much faster to start)

This setup is mostly based on this article:

http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx