> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/~/revisions/rxDAlhB2Kg6ymoJpF9WI/documentation/agent-smith/bulk-onboarding-with-agent-smith.md).

# Bulk onboarding with Agent Smith

When a new agent registers with Rewst, the workflow hits Azure IoT Hub’s identity registry up to five times.

```
Two queries → create → get → tag‑update
```

\
On a standard‑1 (S1) hub, that registry is capped at 100 identity operations per minute, per unit.

```
100 ops ÷ 5 ops / agent ≈ **20 agents / min / unit**
```

{% hint style="warning" %}
**Important: Plan your own throttle or scale‑up**\
\
Rewst deliberately leaves rate‑limiting in your hands so you can tune roll‑outs to match your Azure budget.\
A large, unthrottled burst will exceed IoT Hub limits, pile up HTTP 429 retries, and slow down all of your Rewst workflows during onboarding.\
To avoid this, either add jitter/batching in your RMM script, or do a temporary IoT Hub scale‑up before the push.
{% endhint %}

## What is an IoT hub unit?

A *unit* is simply a slice of IoT Hub capacity you can dial up or down.\
All per‑minute limits scale linearly with both units and SKU size.

| SKU         | Identity ops / min / unit | Agents / min / unit, 5‑call workflow |
| ----------- | ------------------------- | ------------------------------------ |
| **S1 / S2** | 100                       | \~20                                 |
| **S3**      | 5 000                     | \~1 000                              |

### Scenarios

| Choose one                          | How to do it                                                                                                                                                 | Throughput                          | Cost example\*                                         |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ------------------------------------------------------ |
| **Scale the hub (fast)**            | <p>• <code>bash az iot hub update -n \<hub> --sku S3 --unit 2</code><br><br>• Run 5 min before deploy; scale back to <code>S1 --unit 1</code> when done.</p> | \~2 000 agents/min                  | S3 ≈ **$3.47 per unit‑hour** → 2 units × 4 h ≈ **$28** |
| **Throttle in RMM (no Azure cost)** | <p>• Deploy ≤ 50 agents / min / S1‑unit.<br><br>• Add jitter: <code>Start‑Sleep (Get‑Random 5 3600)</code> before install.</p>                               | Current hub limit (\~20 agents/min) | Longer total time; more scripting effort               |

\*US‑East pricing, rounded

## Rules to follow

* Default S1 × 1 → ≈ 20 agents / min.
* Formula: `Agents / min = (100 or 5 000) × units ÷ 5`.
* Scaling is live. Existing connections stay up; a few messages may arrive out of order, which is harmless.

Pick the path that matches your timeline and budget to avoid 429s during mass onboarding.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rewst.help/~/revisions/rxDAlhB2Kg6ymoJpF9WI/documentation/agent-smith/bulk-onboarding-with-agent-smith.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
