Overview
Commerce tracks how many hosting accounts each server holds and uses this to route new orders. The goal: spread accounts across servers evenly and prevent over-provisioning beyond a server's configured limit.
How Capacity Is Calculated
Free Slots = max_accounts − count(services where server_id = X AND status IN (active, suspended))
max_accounts— set on the server record by the admin.- Active + suspended services both count against capacity (suspended accounts still occupy resources on the panel).
- Terminated services are excluded from the count.
Commerce calculates this from its own database records — it does not query the Panel API for real-time account counts.
Viewing Capacity
Go to Admin → Infrastructure → Servers. The table shows:
| Column | Description |
|---|---|
| Name | Server label |
| Group | Assigned server group |
| Module | Provisioning module type |
| Accounts | Current active + suspended service count |
| Max | Configured max_accounts |
| Free | Free slots remaining |
| Status | Online / Offline (based on last test) |
Auto-Assign on Order
When a new hosting order is paid, Commerce:
- Looks up the product's server group.
- Calls
ServerGroup::bestServer()— returns the server with the most free slots. - Sets
services.server_idto that server. - Dispatches
CreateHostingAccountJobtargeting that server.
If multiple servers have equal free slots, the first one returned by the query is selected (by ID ascending).
What Happens When All Servers Are Full
If every server in the group has free slots = 0:
- The order is created but the service stays in
pendingstatus. - An admin notification is sent: "Provisioning held — no available server capacity."
- No job is dispatched until a slot becomes available.
Resolution options:
- Increase
max_accountson an existing server (edit the server record). - Add a new server to the group.
- Manually assign the service to a specific server from Admin → Services → [service] → edit.
Keeping Capacity Accurate
Because Commerce tracks its own records rather than querying the panel, you may need to manually re-sync in certain situations:
| Situation | Action |
|---|---|
| Accounts migrated away from a server outside Commerce | Terminate the relevant service records in Commerce, or decrease max_accounts to reflect real usage. |
| Accounts migrated onto a server outside Commerce | Increase the account count by lowering max_accounts accordingly, or create service stubs for the migrated accounts. |
| Accounts deleted directly on the Panel without going through Commerce | Terminate the service in Commerce to free the slot. |
There is no automatic sync between Panel account counts and Commerce service records. If the two diverge significantly, free slot calculations will be inaccurate.
Adjusting Max Accounts
- Go to Admin → Infrastructure → Servers → [server].
- Update the Max Accounts field.
- Save.
The change takes effect immediately on the next order.