2

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.

TheDude
  • 3,796
  • 2
  • 28
  • 51
Adam Jones
  • 21
  • 3

2 Answers2

1

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!

Alex S
  • 1,171
  • 1
  • 9
  • 25
0

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).

Ramiro Berrelleza
  • 2,254
  • 1
  • 15
  • 27
  • Ramiro, thanks for the reply. To answer: 1. The relay is hosted at the nearest data center to my client. 2. My hosting is a self hosted WCF service using Windows Services. 3. I have done a benchmark - I removed the service bus and spun up the WCF service through a public endpoint on the server. Had a client hit that directly and pulled the 5MB file down within 10 seconds. The download was around 500K/sec. 4. NetTcpRelayBinding offers 0 improvement. I did a WireShark and found that to pull down a 1K file there are 1100 packets received to complete the transfer. That seems a little much... – Adam Jones May 29 '13 at 17:44
  • ... I think there is something up with their SB relay infrastructure. I'm not the only one having this issue. I am working with numerous other developers that are having the same issues. – Adam Jones May 29 '13 at 17:45
  • In that case, you might have better luck cross posting this question on http://social.msdn.microsoft.com/Forums/en-US/windowsazureconnectivity/threads. A few members of the SB team monitor that forum for user issues. – Ramiro Berrelleza May 30 '13 at 02:08
  • Thank you, I did. They were not very helpful. I got some responses and they basically said it was networking issues on my side however that is entirely false. I am working on trying to get it escalated so there can be some resolution. – Adam Jones May 30 '13 at 19:54