0

I am trying to figure out numbers shown as part Azure Metrics for Active Connections in Event Hub. Does anyone has more details around this? here is my scenario- We have a web api which uses EventHub to push data. We are using EventHubClient.CreateFromConnectionString to create Event Hub Connection string and use the same client for all our subsequent api calls in our multi threaded app, so we always have single instance of EventHubClient. Based on this I would have assumed that I should see Active Connection Count as 1 but the nos are around 20 when I call api around 300,000 times. Certainly Active Connection Max was always less. We also plan to create Event Hub trigger Azure function and I would assume that connections will go higher once we do that. My concern is that I see Number of AMQP connections per namespace for Standard is 5000 and when we deploy this code in PROD, will we reach this target soon? Our Web app is hosted on prim and we have 30 boxes with 25 services hosted in each box.

Punit
  • 1,347
  • 3
  • 20
  • 39

1 Answers1

0

Each EventHubClient should only maintain single TCP connection underneath.

Things to check.

  • Make sure EventHubClient is static per process.
  • Log before CreateFromConnectionString and see if you are creating more than once.
Serkant Karaca
  • 1,896
  • 9
  • 8
  • Thanks I did verify and yes EventHubClient is singleton so we always have one instance and we never create more than once. Not sure if Azure function is something which will be creating more Active Connections? Also Active Connections Count is the right no to see if Event Hub has more than 5k connections for that namespace? My concern is how do I find Event Hub has more than 5k on given time. – Punit Feb 28 '20 at 22:29
  • Yes ActiveConnections is the right metric to check. – Serkant Karaca Feb 29 '20 at 02:10