I develop an application which uses Azure EventHub - which claims to be a very scalable solution for publishing and processing large number of events - and now I would like to load test the final solution to see if the whole system fits my requirements or I need to add more throughput units to the EventHub to handle the expected ingress.
My clients are using an HTTP endpoint of the EventHub to publish events which practically means when a client wants to publish an event it sends a HTTPS POST request to a special URL like:
//mynamespace.servicebus.windows.net/myeventhub/publishers/mypublisher
I could load test this service from my local machine easily (for example with Apache JMeter), but unfortunately my local machine has limited resources so I cannot generate a big load to test my service.
What do I mean on big load?
I need to test the system for a given number of requests per second - this given number should be an amount somewhere between 20,000 and 100,000 - so in the worst case, I have to test it with 100,000 requests / second.
There are multiple cloud load testing tools which could generate such a big load and they are fine - however, each load testing tool in the cloud requires some verification step when I have to verify that the system I want to test is a property of mine. (So the load tester won't DDoS the WhiteHouse website.)
In order to do that, I usually have to upload a verification token to the URL which is checked by the load tester tool before running my tests. Unfortunately, in this case, I have no control over the endpoint of EventHub, so I cannot upload a token to:
//mynamespace.servicebus.windows.net/verificationToken.txt
Is there any load testing solution in the cloud, which can work with Azure EventHubs?
If not, how can I load test my EventHub-based service?
What is the nature of the application? Is this a mobile app? Desktop? Web? Depending on the scenario, you could load the app itself onto a cloud host and run it from there either directly or via a load testing tool.
Another option is that since you're only focused on testing Event Hub itself, create a simple web page that does an HTTP post to the event hub (there's a sample doing this via javascript at: https://brentdacodemonkey.wordpress.com/2014/11/18/azures-new-event-hub/), and then pound the heck out of that web page via your preferred load testing tool.
Before you start testing though, ensure you're batching if you feel you need it. Batching sends can greatly increase the ingestion speed. You'll also want to make sure you've configured the number of scale units appropriate to the load you plan to generate. By default you're restricted to 1mb/s inbound and 2mb/s outbound. If you feel 100,000 events/sec will exceed 1mb, then you'll need to make sure you've increased you event hub throughput units. Lastly, whenever possible, send the event asynchronously. its not uncommon when load testing to encounter bottlenecks on the sending application and if you're sending the events synchronously, this bottlenecking is easily interpreted as a throughput issue on the event hub itself.