How do usage plans, rate limits and response times work?

John Wade -

Short answer: Your usage plan limits requests per second, concurrent requests and requests per month. API calls count towards it; token exchanges don't. Reuse each access token for its full 600 seconds, and expect slower first responses after a quiet spell, especially on Beta.

Your usage plan

Each client has a usage plan for each environment, set out in your agreement. It covers requests per second, concurrent requests and requests per month. We email the group address you gave us when you reach 70% and 90% of your monthly allowance.

Request Counts towards your plan?
Calls to Core APIs (EMIS Web, SystmOne, Command, Core Care Plans and others) Yes
Token exchange requests No

If you hit a limit

You'll get a 429 response. Wait before retrying rather than retrying in a tight loop. Send requests at a steady rate. Please contact us if you would like to discuss any changes with your current plan.

Token exchange time

A token exchange usually takes a few seconds and can take longer after a quiet spell while our service starts up (a cold start). Beta has more cold starts because it has less traffic. Production can still have them, but they're less likely. Access tokens are valid for 600 seconds, so reuse each one for every call and renew it in the background before it expires. Your users then never wait for an exchange.

First calls after a quiet spell

The same applies to the APIs: the first call after a quiet spell can be slower. Don't send regular requests to keep a service warm. They count towards your usage plan and they can't guarantee a fast response, because a clinical system may still need to be asked for fresh data.

Clinical system response times

The first request for a patient's full record from SystmOne can take up to about 30 seconds. SystmOne handles one request at a time for each practice. Once fetched, the record is cached for 15 minutes and reads of that patient's other resources are fast in that time. Fetch the record once, wait for it, then read what else you need. Don't retry into a timeout: a second identical request queues behind the first.

More detail: Using Core API Effectively: Parallelism, Patient Records & Caching.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk