We have a .NET Web Role hosted on Windows Azure that only serves a REST API with only a hand few web methods.
API is used rather aggressively by other cloud hosted apps (not browsers). Each method is stateless which enable direct scaling out, and typically interacts with the Blob or Table Storage.
Then contrary to most classical API, the amount of data uploaded to the API is typically much larger than the data downloaded from the API. Then, the size the average message is typically quite big as well (i.e. above 100kB).
So far, we are using WCF on top of ASP.NET Forms with POX messages (Plain Old Xml). The front-end performance are not very good, culprits are:
- XML is verbose ==> bandwidth limitation.
- ASP.NET + WCF + WcfRestContrib slow to parse/serialize messages ==> CPU limitation.
I am wondering what is the best strategy to achieve the highest possible front-end performance to reduce the number of VMs needed to support the workload.
Possible strategies that I am considering:
- Discard XML in favor of ProtoBuf.
- Add upstream GZip compression (classical HTTP compression only applies downstream).
- Discard WCF entirely in favor of raw HttpHandlers.
Does anyone has benchmarked the various alternatives to achieve the most of each Azure VM for such usage?
Ps: Implicitly referring the Lokad Forecasting API but tried to phrase the question in a more general way.
I found the initialization of blob storage (CreateCloudBlobClient(), GetContainerReference() etc) to be quite slow. It's a good idea to take this into consideration when designing Azure services.
I have separate services for anything that requires blob access as it dragged down the time for the pure db requests.