Naijacloud
Docs

Instance types & regions

Two settings decide a service's cost and its latency: the instance type it runs on, and the region it runs in. The instance type can always be changed. An app can change region, but a database stays in the region it was created in.

4 min read

Instance types

An instance type is a fixed amount of CPU and memory. Web services and cron jobs offer five:

SizeResourcesSuited to
Free0.25 CPU · 256 MBOne per workspace, at no charge. Sleeps after 15 minutes without visitors and wakes on the next visit. Side projects and trying things out
Starter0.5 CPU · 512 MBPrototypes, low-traffic apps, dev environments
Pro1 CPU · 1 GBProduction apps with steady traffic
Pro Max2 CPU · 2 GBDemanding, high-traffic workloads
Pro Ultra2 CPU · 4 GBMemory-hungry apps: large server-rendered sites, image work, big in-memory caches

The API calls these FREE, STARTER, STANDARD (Pro), PRO (Pro Max) and PRO_PLUS (Pro Ultra).

Pro Ultra needs a server in the region with 4 GB free. If none has room right now, choosing it is refused with a message saying so, and nothing changes; pick a smaller size or contact support and we'll make room.

A free web service sleeps after 15 minutes without visitors. The next visit shows a short "waking up" page and the app is serving again in under a minute. Paid sizes never sleep, so pick one for anything that has to answer at once, such as a webhook receiver. A background worker has no Free size: it starts at Starter and runs all the time.

Keep a free app awake for a demo

Showing a free app to someone and do not want them to see the "waking up" page? On a sleeping free app, choose Keep awake 24h on the service page. It costs a fixed ₦500 from your balance, wakes the app now, and keeps it running for 24 hours whether or not anyone visits. After that it sleeps again when nobody visits for 15 minutes. You can extend it in its last hour.

Service settings showing the instance types with their resources and monthly prices, above the deployment region
Instance type and region both live on the service's Settings tab.

The current monthly price for each tier is shown on the cards, and in the summary panel while you are creating a service. That figure is the authoritative one, so quote it from the dashboard rather than from here.

Databases use their own tiers, including a small Dev size intended for non-production environments. See Managed databases.

Choosing a size

Memory is usually the binding constraint, not CPU. A service that is killed and restarted repeatedly under load is out of memory, not out of CPU. When that happens we email the service's owner to say it ran out of memory, with its memory limit and the peak it reached.

  • Start at Starter for dev and uat.
  • Use Pro for anything taking real traffic.
  • Move to Pro Max when you can see sustained CPU near its ceiling, or memory headroom disappearing, on the service's overview.
  • Move to Pro Ultra when memory is the limit at Pro Max. It has the same 2 CPUs with twice the memory, so it doesn't help an app that is short of CPU.

Changing the instance type

Change it on Settings and save. The service restarts onto the new size, so there is a brief interruption while the new container starts and passes its health check, and no rebuild is required.

Scaling down below what the process needs will cause it to be killed shortly after starting. If a service becomes unstable right after a downsize, that is the cause.

Regions

A region is where the service physically runs. It matters for two reasons:

  1. Latency to your users. A request from Lagos served from a Nigerian region avoids a round trip out of the country and back.
  2. Latency to your data. A service and the database it reads should be in the same region. A query crossing regions pays the network cost on every call, and applications make many calls per request.

The region is chosen when you create a service, and the picker lists what is available to you. Your workspace's default for new resources is set under Settings. See Projects, environments & services.

Free services run in eu-west only. Upgrading a Free service to a paid size keeps it in eu-west, so to run in af-west (Port Harcourt), create the service there at a paid size. Apps, cron jobs, databases and caches cost 1.5× the listed price in af-west, and object storage costs 1.2×.

Changing region

A web service's region can be changed from Settings. The service is rebuilt and started in the new region, then traffic moves once it is healthy.

A database stays in the region it was created in, so choose its region first.

The private connection between an app and its database only works inside one region. Moving an app away from its database breaks that connection.

To move an app and its database to another region:

  1. Create a new project in the target region.
  2. Add a paid database and your app to it.
  3. Download a backup of the old database, or take a dump with pg_dump, and restore it into the new database.
  4. Check the new app works, then point your domain at it.
  5. Delete the old project.

Anything written to the old database after the backup is not in the new one, so stop writes before you take it.

Related: Usage & billing and Connecting to a database.