2
votes

I have a little console service running on my server that exposes it's endpoint to an azure service bus namespace. I am using webHttpRelayBinding in Streamed mode. I am using the microsoft sample just for testing located here: http://code.msdn.microsoft.com/windowsazure/Relayed-Messaging-Bindings-a6477ba0#content.

I have a console app client running on another computer that connects to my service bus namespace and makes a call to my service interface. I am using the sample call GetImage and in that method all I am doing is returning Stream of a 5MB PDF file.

On the server that is hosting my service I have a 20MB upload/download fiber line. It's wide open and extremely fast. When I open a browser and hit my service as so: https://namespace.servicebus.windows.net/Image/GetImage it pulls the 5MB PDF file correctly however it will only stream the file to me at 90K to 100K per second. I thought at first I was being restricted by upload speeds from the server but with a 20MB fiber up and down that is hard to justify. So I moved the service to my home computer with a measly 750K upload speed. I fired up the service and the relay is hosted. I then had a friend of mine hit the service from his browser at his house to pull the same 5MB PDF file and lo and behold it transfers the file to him at 90K to 100K per second.

I am stumped as to why this is. Can someone please give me insight here? I can show you all the code you need but thought it sufficient to give the description entirely to the problem and reference the microsoft sample I am using.

Thank you in advance.

2

2 Answers

1
votes

A much later response however I found this question relevant to what I'm working on right now.

As suggested, I recommend trying NetTcpRelayBinding with Hybrid connection mode.

http://msdn.microsoft.com/en-us/library/microsoft.servicebus.tcprelayconnectionmode.aspx

By default NetTcpRelayBinding uses Relay which means that traffic goes through Azure. In Hybrid only handshake is done via Azure and then direct connection is established. Keep in mind though that you will loose transfer security with Hybrid setup which may or may not require to setup message level security.

If you try this approach, please let us know is speed increases.

Thanks!

0
votes

A few things to consider:

  • When using service bus relay, under the worst connectivity conditions (NAT on both sides, firewalls, no direct connections), all of your requests will go through Service Bus's datacenters. While the download/upload speeds of your server are important, you also should consider the networking capabilities of the datacenter in between. Where are you hosting your relay? Have you tried using a datacenter that's closer to you and your users?

  • How are you hosting your service, is it WCF or on IIS? You might want to do a benchmark without the relay involved to validate that the slowdown indeed comes from SB, and not some other factors.

  • Are you constraint to using only http-based protocols? You might have a better performance if you use netTcpRelayBinding instead (I'm not completely sure about it streaming capabilities though).