3

I have an azure function that is receiving some payloads from a service, doing some basic operations on it and then forwarding it to an event hub. The solution works fine, but there are spikes in latency occurring quite often(every 10 minutes or so).

My initial assumption was that this is because of the high cost on creating an event hub connection, so I proceeded to creating a simple pooling class that can create multiple resources. That has led to some improvements, but because of the inconsistent nature of the stream, I still face issues when there are spikes in usage.

Looking at the event hub logs, I can see that the connections get closed after 5 minutes. Is there any way of keeping the connection alive for longer. The access method for the pool is FIFO, so being able to keep the connections alive for just a small amount longer would allow me to cycle trough more of them and as a result be better prepared for the spikes in the stream. I have being going trough Microsoft's documentation for Event Hub and I can't see any setting or way of keeping the connection alive for longer.

Any help would be greatly appreciated.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • How is the Azure Function sending data to EventHub ? Are you using output Bindings and use IAsyncCollector or do you send the messages to eventhub yourself via EventHubClient ? Some relevant code would be helpful – Frederik Gheysels Jan 23 '19 at 20:50

0 Answers0