Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Servicebus relay performance

I'm using the service bus with nettcprelaybinding. One one side is OnPremise server that has a constant connection to the service bus. On the other end is a Azure web role that responds to incoming web requests by opening the appropriate service bus and fetch information from server.

My concern is the performance of the channel creation. It takes a couple of seconds to establish a new connection to the onpremise server through the service bus. Caching my ChannelFactory doesn't seem to help much. The transfer performance after the channel is open is very good.

Any suggestions on how to improve the performance. Caching information in Azure can only be done to some extent. I need to connect to the onpremise server.

Can I somehow establish a connection pool to the service bus?

On more thing, there are a number of different onpremise servers so it isn't just one connection to keep alive.

like image 211
user1284390 Avatar asked Apr 03 '12 08:04

user1284390


2 Answers

I'm a member of the Service Bus team at Microsoft. The cost of opening a connection is high in comparison to sending messages because of the multiple communications necessary to get both sides to ensure they are talking to each other.

The mitigation for this is to cache a channel rather than caching a ChannelFactory. There are background keep-alive pings performed for NetTcpRelayBinding connections that should ensure the channel stays open.

like image 50
Todd Reifsteck Avatar answered Sep 28 '22 14:09

Todd Reifsteck


You should be able to pool the connections, but the Azure load balancers will terminate any open connection that sits idle for more then 60 seconds. So if you are caching the connection longer than that between calls, you'll need to implement some kind of heartbeat pattern to help keep the connection alive.

Another option you may want to consider is Azure Connect. This allows you to create a ipsec point to point connection from cloud hosted resources to an on-premises server. It does require a client be installed on the on-premises boxes you want to connect too, but some have been using it to establish a simple gateway connection to an on-premise proxy service.

like image 39
BrentDaCodeMonkey Avatar answered Sep 28 '22 13:09

BrentDaCodeMonkey