lever.json
This page describes the different configuration parameters of lever.json
🔖 lever.json
lever.json
lever.json
is the configuration file provided as part of every Lever deployment. The simplest lever.json
typically contains just the name
of the serivce and an entry point (like jsEntry
).
{
"name": "exampleService",
"jsEntry": "service.js"
}
The following describes in detail every JSON property that can be used to configure the service.
#️⃣ name
(string)
name
(string)The name of the service, the most important thing in lever.json
. It is a string that needs to be unique within the Lever environment it is used. Any preexisting service with the same name will be overwritten when deploying. A couple of rules:
- The name must have at least 3 and at most 255 characters.
- It must not contain
/
,?
,#
or spaces.
#️⃣ description
(string) optional
description
(string) optionalA description of the service.
#️⃣ entry
([string]) optional
entry
([string]) optionalThe binary entry point of the service. At most one of entry
and jsEntry
may be specified as part of lever.json
. If none of the two is specified, then entry
defaults to ["./serve"]
.
The binary entry point represents the command and its arguments that needs to be executed to run the process that listens for Lever connections. For example, to run the command ./runService arg1 arg2
, you need to set this property to ["./runService", "arg1", "arg2"]
.
#️⃣ jsEntry
(string) optional
jsEntry
(string) optionalThe JavaScript entry point of the service. At most one of entry
and jsEntry
may be specified as part of lever.json
.
The JavaScript entry point represents the JS module that exports the Lever methods to be exposed as part of the service's API.
#️⃣ private
(boolean) optional
private
(boolean) optionalIndicates whether the service is private or public. If not specified, the service defaults to public.
A private service can only be accessed by other Lever services from the same environment, via a client library. It is only meant as a backend. By contrast, a public service can also be accessed from outside the environment (either via a client library or via the HTTP API).
#️⃣ maxInstanceLoad
(number) optional
maxInstanceLoad
(number) optionalThe maximum average load per instance of your service. If the total load of your service in a region exceeds this value times the number of instances already running, then Lever automatically starts more instances of this service.
If no value is specified, then maxInstanceLoad
defaults to 10
.
The load is simply the number of requests in flight (currently being processed by the instances). For example, a service that takes about 1 second
to process each request and receives 5 requests/second
, then it has a load of 5
. Meaning that there are, on average, 5 requests being processed in parallel.
#️⃣ minInstances
(integer) optional
minInstances
(integer) optional🚧 Not yet implemented. 🚧
#️⃣ ram
(integer) optional
ram
(integer) optionalThe amount of memory, in MB, to allocate for each instance. If not specified, ram
defaults to 50
.
Note that although memory is the most tangible resource being allocated with this configuration parameter, it is not the only one. CPU, network I/O and (in a future version) disk I/O is also controlled with this property, indirectly. These resources are allocated per instance proportionally to the amount of memory it reserves.
#️⃣ config
(object) optional
config
(object) optional🚧 Not yet implemented. 🚧
Updated less than a minute ago