If your Matchmaker Cloud Code allocator fails on the first allocation attempt after a quiet period, the cause is almost always a Cloud Code cold start.
Cloud Code modules are terminated if they receive no activity in 15mins and then there will be no available warm modules. The module reloads onto a. worker before it can execute, adding several seconds of latency. Since Cloud Code functions have a hard 15-second execution limit, a cold start combined with the allocation logic can push the call over the limit causing it to fail silently. You should see some logs on Matchmaker side but not on Cloud Code.
In a live environment with regular matchmaking activity, the module stays warm naturally.
Cold starts are most visible during development and QA, where there are long gaps between
test sessions. If you are seeing this in production, it points to very low traffic volume.
You can prevent cold starts by invoking the module on a recurring schedule so it never sits idle for 15 minutes. Two options:
- Cloud Code Triggers: configure a recurring scheduled trigger to call your module. Note the minimum frequency is once per hour, which is not frequent enough on its own to cover the 15-minute window.
- External job via the Cloud Code REST API — call the module endpoint from an external service on a sub-15-minute interval. More flexible, but adds an external dependency.
Keep in mind: every warm-up invocation counts toward your Cloud Code usage and will
incur additional cost. Factor this in before setting up a high-frequency schedule.