The Ocalt Query.
Ocalt measures use in a single unit: the Ocalt query (OcaltQL query). Storage aside, nothing else on the platform is rationed. There is no ceiling on machines, subdomains, domains, databases, files, sessions or shares, and every plan, Free included, can use every part of Ocalt. Understanding the query is therefore understanding everything Ocalt charges for.
What a query is
An Ocalt query is one complete run of a script. A script may be a single line or several hundred; it may read one file or write a thousand, query a database, drive a browser, render an image or command a machine. However much it does, one run is one query.
This is deliberate. Ocalt does not charge by the statement, the second or the byte, so a script can be written to do a whole task at once without its author counting steps. The most economical way to use Ocalt is the natural one: put the work for a task in one script.
How queries are spent
Because a query is a run of a script, the question is always what started a run. Each of the following starts one, and costs one query:
- A script sent to Ocalt directly, from the Console, from your own code, or from an Ocalt app acting for you.
- A visit to a page of your website that runs a script. Images, stylesheets and other files served as they are cost nothing, however often they are loaded.
- Each time a scheduled job runs.
- Each check made by a watch, and each time a watch is triggered.
A small number of operations carry a charge of their own, listed below, because each creates something lasting or opens something that others can use.
The daily allowance
Every plan includes a number of queries each day:
| Plan | Queries each day |
|---|---|
| Free | 100 |
| Starter | 1,000 |
| Pro | 10,000 |
| Enterprise | 100,000 |
| Syndicate Starter | 1,000,000 |
| Syndicate Pro | 10,000,000 |
| Syndicate Max | 100,000,000 |
| Syndicate Max B | 1,000,000,000 |
The day is counted in Coordinated Universal Time (UTC). The allowance returns at midnight UTC, which is 02:00 in South Africa. An allowance that is not used does not carry over to the next day.
Query credits
Query credits are queries bought outright, separately from any plan. A one-time purchase of $5 adds 1,000 query credits, and credits may be bought on any plan, as often as needed.
- They are used last. Credits are drawn on only once the day's allowance is spent. A day that stays within its allowance leaves them untouched.
- They do not expire. Unused credits remain on the account indefinitely.
- They are not a daily allocation. A credit, once spent, is gone; it is not replaced at midnight as the allowance is.
When both the day's allowance and your credits are exhausted, a new run is refused with the response 429 Too Many Requests and the message Query Limit Reached. Nothing else is refused for reasons of usage. The refusal ends when the allowance returns at midnight UTC, or as soon as credits are added.
Operations with their own charge
The following operations are charged in addition to the query of the run that performs them:
| Operation | Queries |
|---|---|
| Each application package you generate | 64 |
| Each mailbox you create | 10 |
| Each font you build or update | 5, plus 1 for each character |
| Each subdomain you add | 10 |
| Each custom domain you add | 10 |
| Each network mapping you create | 10 |
| Each tunnel, served file or served folder you open | 25 |
| Each visit to a tunnel, served file or served folder address | 1 |
| Each live screen feed you open | 25 |
| Each live transcode stream you start | 25, plus 25 for each further 24 hours it runs |
| Each audio or video bridge room you create | 25 |
| Each WebAssembly service you publish | 1 |
| Each streaming link made for an audio or video file | 1 |
| Each connection to an audio or video bridge | 1 |
| Each simulation solved, topology optimised or motion simulated | 25 |
| Each 3D scene rendered | 25 |
| Each started minute of video or audio produced by an export, transcode, caption, stabilise or timeline render | 1 |
| Each presentation exported as a video or GIF | 10 |
| Each headless browser session | 10 |
| Each page read by OCR | 2 |
| Each PDF document created | 2 |
| Each map rendered or route calculated | 2 |
How these charges are made
A charge of more than one query is made in a single step, before the operation runs. It is drawn first from what remains of the day's allowance and then, for any remainder, from your query credits. If the two together cannot cover it, nothing is spent: the operation does not run, and the script is told why. A charge is never left half paid.
The run that performs the operation is still one query in its own right. A script that does nothing but create a mailbox therefore costs eleven queries: one for the run and ten for the mailbox. A script that creates two mailboxes and a subdomain costs thirty-one.
What is never counted
- Checking a script without running it. A request made with
dry_run=1is read and checked for errors, and nothing is spent. - A script that cannot be read. If Ocalt cannot parse a script, it is not run, and it is not charged.
- Files served as they are from your website: images, stylesheets, scripts for the browser, downloads.
- The work inside a run, apart from the operations listed above. Reading and writing files, using your databases, sending mail, processing images and video, and commanding your machines are all part of the run's one query.
Worked examples
| What happens | Queries |
|---|---|
| One script that reads a spreadsheet, updates a database and emails a report | 1 |
| A page of your website that runs a script, visited 500 times in a day | 500 |
| A scheduled job that runs every hour, for one day | 24 |
| The same job running every minute, for one day | 1,440 |
| One script that creates a subdomain and a mailbox for a new customer | 21 |
| One script that generates an application package | 65 |
Most of the cost of a busy account comes from what runs without anyone sending it: pages that run scripts, frequent jobs and watches. Choosing the longest interval that still serves its purpose, and serving pages that rarely change as ordinary files, are the most effective ways to use fewer queries.
Seeing your usage
Every Ocalt app shows the day's usage against your allowance, and its menu shows your query credit balance, with links to buy more credits or move to a larger plan. Your account dashboard shows the same figures. For the plans themselves, see Pricing; for a full course on queries, with exercises, see Queries and OcaltQL.