Browserless Terminology
On the main browserless.io site, and inside this documentation site, you'll notice we use a few terms like "worker" or "session". Below is a list of commonly-used terms and what they mean.
Worker
A worker is an instance of the browserless image (found here) running on a virtual-machine. When you create an account you can specify what size of worker and the amount to create. The size of the worker will dictate what types of sites and interactions you can do. Below is a small table of the sizes and the types of work they support.
Worker Size | Use cases | Types of sites |
---|---|---|
Small | Content scraping and screenshots of websites | Static sites (mostly HTML) with little JavaScript and rich-media |
Medium | Full-site screenshots, PDF's and automated testing | Sites with JavaScript and some rich-media (images and videos) |
Large | Full-site PDF's and Canvas screenshots | Large sites with Video and 3D Graphics (WebGL) |
Browserless lets you easily change your worker size and number at any point in the admin screen, so feel free to try it out at any point and scale up or down whenever your use-case changes.
Session
A session is anytime Chrome is actively running and connected to. Browserless, however, automatically queues up to 2X this amount without any changes in your app's code. This allows you to set a baseline of concurrently running traffic, but allows for "bursts" of traffic without having to adjust any of your code (just keep using puppeteer.connect
).
Worker Size | Concurrent Sessions | Total Concurrency |
---|---|---|
Small | 10 | 20 |
Medium | 15 | 30 |
Large | 20 | 40 |
If more sessions are needed, you can either upgrade your worker's size or launch more instances of them to handle traffic.
Pressure
Pressure indicates how much traffic is going on in your workers at any given time. Using the GraphQL API, you can fetch important details like isAvailable
to see if your workers can handle another connection. Doing so will ensure your accout doesn't get overloaded and become unresponsive.
# https://api.browserless.io/graphql
{
pressure(apiToken: "YOUR_API_KEY") {
running
recentlyRejected
queued
isAvailable
date
}
}
This request will return a JSON object with the following payload:
// JSON returned
{
"data": {
"pressure": {
"running": 0,
"recentlyRejected": 0,
"queued": 0,
"isAvailable": true,
"date": 1524762532204
}
}
}
More Coming
Did we miss something? Send us an email and let us know!