Azure / azure-relay-dotnet

☁️ .NET Standard client library for Azure Relay Hybrid Connections

Home Page:https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is HybridConnectionClient ConnectionBufferSize always set to 64k?

nickeeex opened this issue · comments

We have a scenario that we might open a lot of connection but most of the messages are quite small in size.
Our use-case would be hard to implement with multiplexing and would rather just use simple websockets.
With the current azure relay pricing model the minimum data usage of 64kb per connection is too high for us.

int ConnectionBufferSize { get; set; }

Edit:
Changed the value with reflection but it had no effect on the amount of data transferred as viewd in the azure portal.

Is the minimum bytes transferred per connection always 64kb by design?

The ConnectionBufferSize has no effect on the number of bytes that go over the wire. You mention two different things that just happen to use 64k.

Is the minimum bytes transferred per connection always 64kb by design?

Yes. https://azure.microsoft.com/en-us/pricing/details/service-bus/. The last two FAQs are the best description I could find.

For a listener control connection we log the total connected time or 5 min, whichever is larger. A listener connected for 1 min instead of 5 will still get logged as 5 min. A listener connected for 6 min will be logged as 6 min.

For a client/sender connection we log 64KB for the first min and 1KB/min for following minutes or actual whichever is larger. If a client/sender connection closes in less than 1 minute it still gets reported as 64KB (or actual data if larger). Establishing a client/sender connection requires performing a rendezvous (sending a control message to the relay listener which then opens up a new websocket to meetup on the cloud service node where the sender landed), two SSL handshakes, etc.

Thank you for the link to the FAQ! Tried to find information about that for a long time and azure support has been useless with this issue.

Unfortunate that azure relay can't be used as a drop in replacement for queues in our scenario as that would increase costs by 50-60 times. We'll have to figure out if we can do this with fewer connections or if we are just going to have to live with the azure service bus queues having intermittent outages.