MSBA-342 · Lesson 11 of 12 · 20 min

Performance of integrations

▶ Video coming soon A video version of this lesson is on the way.

The eleventh clinic began with a story Desmond told from his partner years. A distribution company had gone live on a Monday. By Wednesday, warehouse workers complained that the mobile app froze for several seconds at every scan. The cause was not the warehouse at all. An e-commerce integration, written in a hurry, polled the sales order entity every ten seconds with no filter, reading every open order with every field, from four servers at once. It worked perfectly in the test environment, which had two hundred orders. In production, with forty thousand, it consumed most of the web servers' capacity, and everyone else waited. Nobody had thought of the integration as a performance risk, because integrations do not have users who complain.

The lesson of the story was the theme of the clinic: integrations share the system with people, and a careless integration can harm every user. Prudence would learn how Microsoft protects the system with service protection limits and priority-based throttling, how integrations should respond when throttled, and how to design each integration pattern from the earlier clinics so that it rarely needs protecting against.

Service protection API limits

Finance and operations apps apply service protection API limits to OData and custom service endpoints in online sandbox and production environments. They do not apply to development environments, which is one reason performance problems can hide until UAT. The limits come in two kinds. User-based limits once capped the number of requests, combined execution time and concurrent requests per user and application in a five-minute window. Microsoft Learn states that these are no longer enforced: they were made optional in 2023, turned off by default in version 10.0.35 and turned off on all environments in 10.0.36, when the option to enable them was removed. Resource-based limits remain in force for version 10.0.19 and later. They do not count requests per caller; they watch the aggregate use of web server resources such as memory and CPU, and when the servers are under pressure, they start rejecting requests.

A rejected request receives the HTTP status 429, Too Many Requests, with a message saying the system is experiencing high resource utilization, and a Retry-After interval. Microsoft is explicit that this error does not necessarily mean the integration that received it is the cause: it means the system as a whole is busy. Every client must handle a 429 by waiting for the Retry-After interval and trying again, rather than failing outright or, worse, retrying immediately and adding to the load.

Service protection limits in finance and operations apps.
AspectWhat Microsoft Learn documents
Endpoints coveredOData and custom services, in online sandbox and production environments
User-based limitsNo longer enforced; disabled on all environments from version 10.0.36
Resource-based limitsEnforced from version 10.0.19, based on aggregate web server use
Response when limitedHTTP 429 Too Many Requests with a Retry-After interval
Exempt services (current list)Including the data management framework, recurring integrations, Data Integrator, Office integration, the warehouse mobile app and virtual tables with the Power Platform integration enabled

The exempt list is worth reading carefully. The data management framework and recurring integrations are exempt, which is one reason bulk loads belong there and not in OData. Virtual tables are exempt when the Power Platform integration is enabled, although requests may still be subject to Dataverse's own API limits. Microsoft says these exemptions apply for now and that it will give notice before changing them, and it recommends that even exempt services handle 429 responses. Desmond's conclusion for the register was simple: every integration, exempt or not, would implement retry with Retry-After.

A chart with time on the horizontal axis and web server resource use on the vertical axis. A rising line crosses three horizontal threshold lines labeled low priority throttled, medium priority throttled and high priority throttled, from bottom to top. Beside each line, a label names a Cobalt Ridge integration: nightly reconciliation reads at low, distributor portal and plant quality at medium, warehouse robot confirmations at high. A note says requests above a threshold receive 429 with Retry-After.
With priority-based throttling, low-priority integrations are throttled first as resource use rises.

Priority-based throttling

When resource-based limits start rejecting requests, which integrations should be rejected first? By default, the system cannot know that a warehouse robot's pick confirmation matters more than a distributor's nightly reconciliation. Priority-based throttling lets a customer tell it. On the Throttling priority mapping page under System administration, Setup, an administrator with the System administrator or Integration priority manager role creates a mapping for each integration: an authentication type, either a Microsoft Entra application identified by its client ID or a user, and a priority of Low, Medium or High. Low-priority integrations are throttled at a lower level of resource use than medium ones, and medium at a lower level than high ones. The mapping applies to the resource-based limits for OData and custom service integrations.

Desmond drafted the mapping for the register. Integrations that kept physical work moving were High: the warehouse robot confirmations, once they existed. Integrations that served partners in real time were Medium: the Prairieline portal and the plant quality system's occasional reads. Integrations that could wait were Low: the Prairieline nightly reconciliation, which ran under a separate app registration for exactly this reason, and any ad hoc reporting tool that connected through OData. He noted that the mapping only helps if each integration has its own app registration; if three integrations share one client ID, they share one priority.

The planned throttling priority mapping. The robot adapter is the subject of the next clinic.
System administration > Setup > Throttling priority mapping   (plan for production)

Authentication type          Client ID / User              Priority
Microsoft Entra application  Tarnwick robot adapter        High
Microsoft Entra application  Prairieline warranty portal   Medium
Microsoft Entra application  Plant quality adapter         Medium
Microsoft Entra application  Prairieline reconciliation    Low
Microsoft Entra application  Ad hoc OData reporting        Low

Handling 429 in a client

Every client in the register had to implement the same retry behavior, and Desmond wrote it down as a short specification for the partner's integration team. On a 429, read the Retry-After value, wait at least that long, and retry the same request. For other transient failures, such as a timeout or a 503, retry with exponential backoff and a random jitter, so that many clients do not retry in lockstep. Cap the number of retries and the total time, then fail visibly to the integration's error queue. And make every write idempotent, as in the custom services clinic, so that a retried request that had actually succeeded the first time does no harm.

The retry specification Desmond gave the integration team. It is a specification, not code.
Retry policy for Cobalt Ridge integration clients

1. Send the request with a unique request ID.
2. On 429: wait at least the Retry-After interval, then resend the same request.
3. On 408, 500, 502, 503 or 504: wait 1, 2, 4, 8, then 16 seconds (plus up to
   one second of random jitter each time), resending after each wait.
4. Stop after 5 retries or 10 minutes in total, whichever comes first.
5. If still failing: write the request ID and the last response to the
   integration's error queue and alert the owner.
6. Every write carries the caller's own reference so a repeat is harmless.

Designing OData and service calls for performance

Most performance problems are designed in, not caused by limits. Desmond listed the habits that kept OData and custom service integrations light. Read only what is needed: use the select option for fields and a filter for rows, especially a filter on a change date for synchronization jobs. Never poll without a filter, and prefer business events to polling altogether. Batch related writes in a changeset rather than sending dozens of separate requests. Keep entities lean, with indexed keys and no expensive virtual fields, as earlier clinics recommended. Avoid chatty sequences, where a client makes one request to find a record, another to read its lines and a third to read each line's product; an entity with the right joins or a custom service that returns the whole answer in one call is far cheaper.

Concurrency deserves attention too. A client that sends many requests in parallel can finish faster, but every parallel request competes with users. Microsoft's guidance on maximizing throughput under service protection is to scale gradually and respond to 429 by slowing down. For Cobalt Ridge, Desmond set a ceiling of four parallel requests for any single integration, raised only after a load test in UAT showed headroom.

Designing bulk integrations for performance

The data management framework has its own performance settings, and the developers' choices in entity design decide whether the fast paths are available. Set-based processing lets the framework copy staging rows to the target with set-based SQL statements instead of row by row, but only when the entity is enabled for set-based operations and no row-level logic, such as an overridden insert method, stands in the way. The project's entity settings also allow running the copy in parallel through batch tasks, with a configurable number of tasks and rows per task, and some entities allow skipping staging altogether when no validation in staging is needed.

Performance levers for bulk integrations.
LeverWhere it is setWhen it helps
Set-based processingEntity property and project entity settingsLarge loads into simple entities without row-level logic
Parallel batch tasksEntity execution parameters in data managementLarge imports that can be split into independent chunks
Skip stagingProject entity settings, where the entity supports itTrusted data that needs no correction step
Enhanced parallel package importData management framework parametersSeveral packages imported at the same time
SchedulingRecurring data jobs and batch groupsMoving heavy loads away from working hours

The warranty cutover load from the recurring integrations clinic was the test case. Eleven thousand warranties per company took nine minutes row by row in the CONFIG sandbox, because the entity's validateWrite ran the shipped-to-customer check, which made two queries per row. For cutover, that check was not needed, because the historic warranties had been validated in the old system. Desmond did not remove the check; instead, he made it skip when the entity was being imported by the cutover data project, using the import context, and turned on parallel tasks. The load dropped to under two minutes. He wrote the reason into the code comment and the decision log, because a skipped check is a decision that someone will question later.

Business events and batch capacity

Business events are sent by batch, using the processing threads and bundle size in the business event parameters. If many events are raised at once, for example when a large sales order with dozens of configured pump lines is confirmed, they queue and are sent as threads become free. That is usually fine, but events compete for batch capacity with every other batch job. Desmond asked the system administrator to put business event processing in its own batch group on a server that was not shared with the heaviest month-end jobs, and to watch the business event errors and queue size during the first month-end after go-live.

Load testing the register

Prudence was given the job of planning the load tests, and the plan taught her more about the integrations than any clinic so far. For each integration she needed a realistic peak. The Prairieline portal's peak came from the distributor's busiest spring week the year before: about four hundred registrations and two thousand coverage checks in a day, most of them in two morning hours. The plant quality system's peak came from the number of casting receipts on the busiest day of the year: a few hundred certificates. The robot integration had no history, so its peak came from Henrik's plan for the pilot zone, which Prudence would meet in the next clinic. She then wrote test scripts that drove each integration at its peak, at the same time, while a group of testers worked through the busiest user scenarios in the browser and the warehouse mobile app.

The first run found one serious problem. The coverage check, which had been fast in isolation, slowed to over two seconds at peak because the claim lookup ran once per covered part instead of once per call. The fix was a single query in the service class, and the second run kept the check under three hundred milliseconds at peak. Nobody would have found the problem without running the integrations together, because each one alone was fine.

Monitoring after go-live

Performance is not settled at go-live. Volumes grow, partners change their code, and a new integration arrives. Desmond's runbook for the first three months after go-live included a weekly review of four signals: the count of 429 responses by client ID, the response times of the busiest OData entities and service operations, the business event queue and error counts, and the duration of the largest recurring data jobs. Each signal had an owner and a threshold that would open a support ticket. He also asked each partner to share its own error counts monthly, because a partner that silently retries a failing call for weeks is a performance risk that only shows up in their logs.

Measuring before guessing

Desmond ended the clinic with his oldest rule: measure before guessing. Microsoft provides telemetry for finance and operations environments, including views of throttled API requests in the environment's monitoring tools, and the Trace Parser from the fundamentals course shows where time goes inside a single request. Load tests in UAT, with realistic volumes and realistic parallelism, show how an integration behaves when it matters. For each integration on the register, Desmond added two numbers: the expected peak requests per minute and the measured response time at that peak in UAT. Any integration without both numbers would not be approved for production.

Worked problem

Diagnosing a throttled integration

In UAT load testing, the Prairieline portal receives occasional 429 responses at the same time as a test run of the nightly reconciliation. Both use the same app registration. Users in the browser notice slowness. What should Prudence change?

Show solution
  1. A 429 under resource-based limits means the system is busy, not that the portal itself is the cause.
  2. The reconciliation reads every warranty without a change-date filter; adding the filter reduces its load the most.
  3. The two integrations share a client ID, so they cannot have different priorities. Give the reconciliation its own app registration and map it to Low, keeping the portal at Medium.
  4. Confirm that both clients honor Retry-After and cap parallel requests, then repeat the load test.

Answer: Filter the reconciliation, split the app registrations and map priorities, confirm retry behavior, and measure again.

Common mistakes

  • MistakeAssuming a development environment shows production behavior.

    InsteadService protection limits do not apply in development environments; load test in a sandbox.

  • MistakeRetrying immediately after a 429.

    InsteadWait at least the Retry-After interval, and use backoff with jitter for other transient errors.

  • MistakeSharing one app registration across several integrations.

    InsteadGive each integration its own client ID so it can have its own throttling priority.

  • MistakePolling an entity without a filter.

    InsteadFilter on change dates or use business events instead of polling.

Summary and key terms

  • Service protection limits apply to OData and custom services in online sandbox and production environments; user-based limits are no longer enforced.
  • Resource-based limits reject requests with HTTP 429 and a Retry-After interval when web servers are under pressure.
  • Priority-based throttling maps Entra applications or users to Low, Medium or High priority on the Throttling priority mapping page.
  • Clients must honor Retry-After, use backoff with jitter, cap retries and make writes idempotent.
  • Lean entities, filters, batching, set-based processing and scheduling prevent most performance problems.
Service protection API limits
Limits that protect finance and operations web servers from excessive API load.
Resource-based limits
Service protection based on aggregate web server resource use.
HTTP 429
The Too Many Requests status returned when a request is throttled.
Retry-After
The interval a throttled client must wait before retrying.
Priority-based throttling
A mapping of integrations to Low, Medium or High priority for resource-based throttling.
Set-based processing
A data management option that writes many rows with set-based SQL instead of row by row.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which roles can maintain the throttling priority mapping?

    Show answer

    System administrator or Integration priority manager.

  2. Why must even exempt services handle 429 responses?

    Show answer

    Microsoft recommends it, and exemptions may change with notice.

  3. What stopped set-based processing from helping the warranty cutover load at first?

    Show answer

    Row-level logic in validateWrite that ran two queries per row; set-based paths need no row-level logic in the way.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz