skip to content

Capacity and Cost

Renting an engine makes capacity and spend constraints a suite has to be written for: what the account may run at once, and what an open session keeps costing. Interviewers probe both.

on this pageshow

explore

questions

16

Does raising a test runner's worker count raise a hosted provider's session ceiling?

level: juniorimportance: must knowfreq 72%

answer

  1. opposite sides of a boundary
  2. your config never leaves your machine
  3. asking is not the same as getting
  4. start-up succeeds either way
  5. it helps only where headroom exists

basics

~20 s

No. The worker count is a local setting that decides how many sessions your suite tries to hold at once; the ceiling belongs to the provider account and is enforced there, whatever your runner is configured to do.

solid answer

~50 s

No — they are settings on opposite sides of a boundary. The worker count is read by **your** process at start-up and decides how many tests run at once, and therefore how many remote sessions your side will request. The ceiling is applied by the **provider** when a new-session request arrives carrying your account's credential. Nothing in the ordinary shape of this exchange carries your configured width across: the client issues session requests and the service answers them. Widening the runner beyond what the account admits produces no start-up error at all, because start-up is entirely local and entirely successful; the consequence appears later, as workers that asked for a session and did not receive it. Raising the worker count does help where the account has width you are not already using, which is exactly why the wrong conclusion is so easy to reach.

code

python · 10 lines
python
# Grocery-delivery slot-picker suite, runner configuration.
# Entirely our side - none of this reaches the provider.
workers = detect_local_capacity()          # a guess about THIS machine
run_suite(parallel_workers=workers)        # each worker drives a remote browser

# What the provider actually sees is only this, repeated per worker:
#   a new-session request, authenticated as our account
#
# It answers each request against the ACCOUNT's ceiling. The value of
# `workers` is not part of what we send and is never negotiated.

go deeper

for a junior

Be ready to answer this in one sentence and name both owners: your configuration controls what you ask for, the provider controls what you get. That distinction is what the question is testing.

for a middle

Be ready to explain why an over-wide runner produces no start-up error, and what the symptom actually looks like in the run log when the requests reach the far side.

for a senior

Be ready to say what you would instrument to prove it: concurrently-open sessions rather than requested ones, compared against the configured width across several runs.

for a principal

Be ready to set the team's rule for how this width is chosen at all, so that it is derived from a measured ceiling rather than from whatever default each new pipeline inherits.

## The short answer, and why it is worth asking No. Raising a test runner's worker count raises how many remote sessions your suite *asks for*. It does not raise the ceiling the provider applies to your account, because that ceiling is not derived from anything your runner says or does. It is worth asking as a screening question because the wrong answer is so easy to arrive at honestly. A team raises the worker count, the suite finishes faster, and the conclusion "the worker count controls our parallelism" follows naturally. It was true that day because the account had headroom. It stops being true the moment it does not, and nothing in the configuration changes to announce that. ## Where each setting lives - The **worker count** is local. It is read by your process, on your machine or your CI runner, at start-up. It is a decision about your own side: how many tests to run at once, how many browsers to drive concurrently, how much of your own machine's capacity to commit to driving them. - The **account ceiling** is remote. It is applied by the provider when a new-session request arrives carrying your account's credential, and it applies across everything that presents that credential. - There is no channel between them in the ordinary shape of this exchange: the client issues session requests and the service answers them, and your configuration file is not part of that conversation. A worker that cannot get a session is a worker that made a request and did not receive it, which is a completely different situation from a worker that was never created. That last point is the one juniors most often blur. Configuring more workers does not produce an error at start-up, because start-up is entirely local and entirely successful. The consequence shows up later, at the far side, when the requests arrive. ## What the worker count is actually good for It is not useless — it is simply a different instrument: - It decides how much of *your* machine you commit. Every worker process costs memory and CPU on your runner even though the browser itself is elsewhere, so an over-wide worker count can slow your own side down. - It decides how much of an available ceiling you actually use. If the account permits more than you are asking for, raising the worker count is exactly the right move, and it is the only case where raising this knob raises effective parallelism. - It decides how quickly a run offers its work. A suite that offers all its requests at once behaves differently, from the provider's point of view, from one that offers them gradually. So the correct instinct is: raise the worker count **up to** what you have established the account admits, and no further. Beyond that point you are generating requests that cannot become sessions, and what the service does with them is its business, not your configuration's. ## A worked example A nightly regression suite for a grocery-delivery slot picker runs against a hosted provider. The team wants it to finish sooner, so they widen the runner substantially and watch the next run. 1. Every worker starts. No error. The local side is entirely healthy. 2. A first group of workers receives sessions promptly and begins driving browsers. 3. The rest do not. From inside the harness they look like workers that are taking a long time to get going. 4. Wall-clock barely improves, because the number of browsers actually working at once did not change. 5. The run log, if it records concurrently-open sessions rather than requested ones, shows the plateau plainly — and that recording is the cheapest diagnostic on this whole subject. The fix is not a larger worker count. It is either accepting the ceiling and sizing to it, or changing the account's arrangement with the provider — which is a commercial decision, not a configuration one. ## What a good answer sounds like A good junior answer names both sides and says which of them is authoritative: "the worker count is our setting and controls what we request; the ceiling is the provider's and controls what we get, so raising ours cannot raise theirs." A better answer adds the asymmetry explicitly — that raising the worker count *can* help when the account has spare width, and cannot help when it does not — because that is the distinction that turns a memorised rule into something usable. A weak answer treats the two as one number, or claims the runner advertises its width to the provider when it connects. Nothing in the ordinary shape of this exchange carries a desired parallelism from client to service; the client requests sessions individually, and the service answers each request as it arrives.

  • If the runner is over-wide, what does the failure look like from inside the harness?
    Not like a configuration error. Every worker starts cleanly, a first group receives sessions and begins work, and the rest look like workers that are taking an unusually long time to get going. Wall-clock barely improves. Logging concurrently-open sessions rather than requested ones makes the plateau obvious immediately.
  • When is raising the worker count genuinely the right move?
    When the account admits more than you are currently asking for. That is the only case where raising the local knob raises effective parallelism: you are converting unused entitlement into work. Raise it up to what you have established the account admits, and stop there.

saying these in an interview costs you the question

  • Says the runner advertises its width to the provider when it connects
  • Expects an error at start-up when the worker count is too high
  • Treats the worker count and the account ceiling as one number
  • Concludes the worker count controls parallelism because raising it once helped
  • Thinks moving to a bigger CI runner raises what the provider admits
open as a page

What is a hosted browser provider's session ceiling attached to, and what is it not attached to?

level: middleimportance: must knowfreq 66%

basics

~20 s

It is attached to the account a session request authenticates as, not to a machine, a pipeline, a repository or a person. Everything presenting that account's credential draws on the same ceiling, including runs your team never started.

open as a page

How does a suite tell a capacity refusal from a genuine session failure at a remote grid?

level: seniorimportance: must knowfreq 57%

basics

~20 s

Not from the error code. WebDriver defines no capacity error, so implementations reuse the generic ones and only the message string names the cause. Read the message text, the failure's timing, and your own queue counters instead.

open as a page

A hosted browser provider is holding your new-session request open — what bounds that wait?

level: seniorimportance: must knowfreq 66%

basics

~20 s

Nothing on the far side necessarily bounds it. Selenoid, unmaintained per its own README, waits until a slot frees or the client disconnects, with no server deadline, so your client's read timeout is the bound you actually control.

open as a page

On a hosted browser provider, what does a test run consume, and what sets how much?

level: juniorimportance: should knowfreq 66%

basics

~20 s

A run consumes session time — the count of sessions open at once multiplied by how long each stays open. Running wider shortens wall-clock but barely moves that total; shortening each session shrinks it directly, and idle time counts.

open as a page

What can a hosted browser provider count as usage when your test suite runs?

level: juniorimportance: should knowfreq 70%

basics

~20 s

A hosted browser provider can count the time each session stayed open, the parallelism you reserved whether you used it or not, the people granted access, or some combination of those. Each shape rewards a different discipline.

open as a page

Why does a hung test on a remote browser grid keep consuming despite an idle timeout?

level: middleimportance: should knowfreq 49%

basics

~20 s

An inactivity timeout measures silence on the wire, not progress in the test. A hung case that polls keeps sending commands, so the timer keeps resetting and the session keeps its slot until a bound of your own stops it.

open as a page

On a hosted browser fleet, what must your harness record to measure consumption?

level: middleimportance: should knowfreq 44%

basics

~20 s

Record a row for every session your suite opens: when you asked, when it became usable, when you closed it, how it closed, and which case and job it served. Duration comes from the timestamps; concurrency comes from overlapping them.

open as a page

At a hosted browser provider, which bounds your parallelism: worker count or the account ceiling?

level: middleimportance: should knowfreq 58%

basics

~20 s

Neither prevails by default: your suite's real parallelism is bounded by whichever is lower, the runner's worker count or the account ceiling the provider enforces at admission. Configuring more workers raises what you request, never what you are granted.

open as a page

Why does a browser provider charge counted by people with access ignore how your suite runs?

level: middleimportance: should knowfreq 48%

basics

~20 s

Access-counted charging is a function of your organisation rather than your workload, so nothing the suite does changes it. Running longer, wider or more often costs nothing extra; only the size of the group with access moves the charge.

open as a page

When a hosted browser provider has no free slot, what can it do with your new-session request?

level: middleimportance: should knowfreq 63%

basics

~20 s

A provider with every slot busy either holds the new-session request until a slot frees or refuses it at once. Holding burns runner wall-clock and hides the ceiling; refusing surfaces it immediately and forces the suite to decide.

open as a page

A CI runner is killed holding open hosted browser sessions. What keeps consuming, and what ends it?

level: seniorimportance: should knowfreq 54%

basics

~20 s

A killed runner sends no close command, so its sessions stay open on the provider's side, consuming and holding their slots. They usually end when you delete them later, or when the far side's inactivity reaper notices the silence.

open as a page

One browser-provider account serves your nightly suite and every pull-request run, and they starve each other. What do you do?

level: seniorimportance: should knowfreq 44%

basics

~20 s

Treat the account ceiling as a shared budget with an owner: establish it by observation, enumerate every claimant on that account, give each a declared share of it, and guard the sum so a later pipeline cannot silently exceed it.

open as a page

A browser provider's bill did not move after your veterinary booking suite's sessions got much shorter. Why?

level: seniorimportance: should knowfreq 54%

basics

~20 s

A duration lever only moves a bill that is a function of duration. A flat charge after shorter sessions is evidence about the meter: it is counting reserved parallelism, granted access, or an interval you did not actually shorten.

open as a page

Why does reserved parallelism at a browser provider cost the same when your suite sits idle?

level: middleimportance: nice to knowfreq 40%

basics

~20 s

Reserved parallelism buys the right to run a set width of sessions at once, so the charge attaches to the reservation itself rather than to any session you open. Idle reserved capacity costs exactly what busy reserved capacity costs.

open as a page

How do you decide whether a suite on a busy hosted browser fleet waits for a slot or fails fast?

level: principalimportance: nice to knowfreq 41%

basics

~20 s

Waiting is right only when there is nowhere else to go and giving up costs more than the wall-clock. With an alternative host, region or later run available, refusing at once and moving on is the better default.

open as a page