OverflowStack
OverflowStack

Reputation: 919

Device and module twin reads & Queries - Understanding throttling

I have S1 IoT Hub. Looking at official documentation, these are the throttling limits for Twin reads:

Queries                                [20/min/unit]    
Twin (device and module) reads         [100/sec]        

What I don't understand is the difference between the two and where & how I can achieve the second 100/sec reads.

Using official C# SDK (Microsoft.Azure.Devices) at max I can achieve 30-40 Twin reads in a minute. So exactly what does 100/sec limit mean? Is there some sort of a special library for it?

Stopwatch watch = new Stopwatch();
watch.Start();
while (watch.ElapsedMilliseconds < 60000)
{
    IQuery twinQuery = registry.CreateQuery("SELECT * FROM devices");
    Console.WriteLine($"Twin request #{i}");
    var result = await twinQuery.GetNextAsTwinAsync();
    i++;
}
watch.Stop();
Console.WriteLine($"Elapsed time in seconds: {watch.Elapsed.TotalSeconds}. Total rquests: {i}");

Upvotes: 0

Views: 83

Answers (1)

Mark Radbourne
Mark Radbourne

Reputation: 653

These quotas are not per device. This is the maximum of the total of all devices.

Upvotes: 1

Related Questions