Reference
Resource Usage
While in beta, usage of rngo is free, but limited based upon simulation output volume:
- the maximum volume for a single simulation is 100 MB
- the maximum aggregate volume per user per day is 1 GB
All simulations are also limited to a fixed state volume of 64 MB, regardless of output volume.
Eventually, rngo will offer paid plans with usage-based billing that include unlimited output volume and increased state volume limits.
Output Volume
A simulation's output volume is the sum of each stream's output volume, which is calculated by taking the product of:
- stream length - the maximum number of events that the stream could produce given the simulation spec.
- schema width - the number of bytes required to store the largest value described by the stream's schema.
The output volume is this number rounded up to the next megabyte.
Stream Length
A stream's length is the maximum number of events that the stream could produce given the simulation specs.
Fixed Rate
If the stream has a fixed rate, the length is the rate multiplied by the simulation duration in seconds.
Variable Rate
If the stream has a variable rate, the length is calulated by partitioning the domain of the function and summing the maximum of each partition's upper- and lower-bound rate.
See the Streams reference for more on rates.
Schema Width
A schema's width is the number of bytes required to store the largest value described by the schema.
Null
A null
schema's width is 1.
Boolean
A boolean
schema's width is 1.
Integer
An integer
schema's width is large enough to fit it's upper bound. For example, the following schema has width 3:
type: integer
maximum: 65600
The width must also accommodate the lower bound - this schema also has width 3:
type: integer
minimum: -65600
maximum: 128
Upper and lower bounds may also be derived from the exclusiveMinimum
, exclusiveMaximum
keywords, along with from rngo.value
expressions.
If no bounds are specified, we use a default minimum
of -2147483648
and a maximum
of 2147483647
, so the following schema has a width of 4:
type: integer
Number
A number
schema's values are represented as integers, with the 4 least significant digits representing the fractional part. So the following schema has a width of 3:
type: number
minimum: 0
maximum: 32
This is because the largest possible value is represented as 320000, which requires 3 bytes. This schema has width of 4 to accomodate the integer 20458900:
type: number
minimum: -2045.89
maximum: 32
String
A string
schema's width is the length of the longest possible string multiplied by 4, so this schema has a width of 80:
type: string
maxLength: 20
The width may also be derived from the pattern
and format
keywords, along with from rngo.value
expressions.
If no keywords are specified, we use a default maxLength
value of 64
, meaning ther following schema has a width of 256:
type: string
Array
An array
schema's width is the maximum length of the array times the size of its items. So the following schema has a width of 5:
type: array
items:
type: integer
minimum: 0
maximum: 128
maxItems: 5
If maxItems
is not specified, we use a default value of 64
Object
An object
schema's width is the sum of the width of its values. This schema has a width of 19:
type: object
properties:
id:
type: integer
mimum: 0
maximum: 512
name:
type: string
maxLength: 4
admin:
type: boolean
Widths are calculated recursively, so the following schema has a width of 127:
type: object
properties:
id:
type: integer
posts:
type: array
items:
type: object
properties:
title:
type: string
maxLength: 10
published:
type: boolean
maxItems: 3
enum
/ const
If a schema specifies an enum
or a const
, the width will be the item with the most bytes. For example, this schema has length 5:
type: string
enum:
- one
- two
- three
Similarly, this schema has width 12:
type: object
enum:
- name: Alice
age: 32
- name: Bob
age: 45
- name: Methuselah
age: 969
State Volume
A simulation may need to maintain state in order to fulfill certain schema definitions, for example to guarantee uniqueness or referential integrity.
Regardless of output volume, a simulation's state volume may not exceed 64 MB; any attempt to run such a simulation will result in an error.
You can reduce a simulation's state volume by:
- reducing the simulation's output volume
- removing uniqueness constraints
- removing stream references