I and a few other developers are having a an AI competition. Basically, we have a simple board game and we've each written AIs that will be hosted on our own webservices to play against each other.
I've got one up and running that is a simple WebApi 2 based service that is published to Azure. My expectation is it'll be quiet most of the time, and then suddenly when a game starts, it'll receive 200-400 requests all potentially very quickly (a game can last only a few seconds). The game server and AI communicate with run-of-the-mill JSON POSTs.
My issue is, Azure seems to be throttling the requests. The first few moves happen very fast, and then everything slows down.
I'm wondering if Azure thinks it's a potential DOS attack or something. It can take over a second to get a move back once things slow down. A few points of interest:
- This never happens when hosted locally.
- There is no database at all.
- It happens even with a simple test AI that just moves pieces randomly (so no compute load)
- It happens when the game host is also deployed to Azure (so it's two Azure sites talking to each other).
So how can I fix this? Is there a setting somewhere I'm missing where I can tell Azure this kind of behavior is expected? I currently have it as a Shared service, but I tested it as a Basic service before with two instances, and I still was seeing the slowdown.