October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Scale Selenium Grid with KEDA

Use KEDA’s Selenium Grid scaler to respond to queued WebDriver sessions, with practical checks for capability matching, node capacity, ScaledJob strategy, and Grid’s native Kubernetes session factory.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use KEDA’s built-in Selenium Grid scaler to add browser-node capacity when WebDriver session requests are waiting in Grid’s queue. Configure a ScaledObject for each browser pool, point its trigger at Grid’s GraphQL endpoint, and make nodeMaxSessions match the actual session limit on those nodes. Then bound the replica count to what your cluster can run and verify how your chosen KEDA scaling strategy handles active sessions.

How KEDA scales Selenium Grid

Selenium Grid routes WebDriver scripts to remote browser instances so tests can run in parallel across browsers or platforms. KEDA’s built-in Selenium Grid scaler, available since KEDA v2.4, observes pending session requests through Grid’s GraphQL endpoint and scales browser capacity to meet that demand. The scaler’s configuration includes the maximum parallel sessions each node can support, so its estimate of capacity must agree with the node’s real setting.

For a persistent browser-node deployment, KEDA uses a ScaledObject to scale the node workload. You can also use a ScaledJob when browser nodes are run as Jobs; its behavior depends on the selected scaling strategy and needs a separate check.

Why scale from the session queue

CPU and memory utilization do not always reveal that browser capacity is insufficient: every node may be occupied even while resource utilization remains below an HPA threshold. SeleniumHQ’s 2022 discussion of browser pods describes this mismatch and also warns that arbitrary scale-down can interrupt tests running on a node. Queue-aware scaling responds to waiting sessions more directly, but it does not replace graceful draining, session completion, or cluster-capacity planning.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure a KEDA ScaledObject for a browser pool

Use one Selenium Grid trigger for each browser capability pool you intend to serve. Its URL is the Grid GraphQL endpoint, commonly http://selenium-hub:4444/graphql, and its capability filters should identify the requests and node stereotypes that belong to that pool. Current KEDA scaler documentation names browserName, browserVersion, and platformName as relevant matching fields.

This illustrative skeleton targets a persistent Chrome-node workload. It is not a tested, ready-to-apply manifest: replace the names, namespace, capability values, replica limits, and session count to match your deployment.

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: selenium-chrome
spec:
  scaleTargetRef:
    name: selenium-chrome-node
  minReplicaCount: 0
  maxReplicaCount: 8
  triggers:
    - type: selenium-grid
      metadata:
        url: http://selenium-hub:4444/graphql
        browserName: chrome
        platformName: Linux
        nodeMaxSessions: "1"

The example’s nodeMaxSessions value of 1 is only an example. Set it to the same concurrency configured on the Grid node using --max-sessions or SE_NODE_MAX_SESSIONS. If the trigger assumes more sessions per node than the node can actually run, KEDA’s capacity calculation will not reflect the real pool.

Set a realistic replica ceiling

Choose maxReplicaCount from the resources your cluster can actually provide, including each browser’s resource requests and workloads sharing the cluster. The KEDA documentation does not prescribe a universal replica count, throughput target, or cost estimate. Start with a bound your cluster can support, then evaluate capacity under representative test concurrency.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep Grid authentication out of public manifests

If your Grid endpoint requires authentication, KEDA’s guide supports storing the URL and credentials in a Kubernetes Secret and referencing them through TriggerAuthentication. Do not place credentials in a manifest that is publicly accessible. Follow the instructions for the exact KEDA version deployed; scaler documentation is versioned and can change.

Choose the right ScaledJob session handling

KEDA also documents browser nodes run as Jobs, where a node serves a session and then terminates. For the default or a custom ScaledJob strategy, the current KEDA guide says the default inclusion of ongoing sessions is appropriate. For the accurate or eager strategies, set includeOngoingSessions: "false". With those strategies, ongoing work is not subtracted in a way that allows it to be added back to reported demand; leaving it included can therefore cause active sessions to be counted repeatedly and unnecessary Jobs to be created. Confirm the behavior against the KEDA version you run.

Check Kubernetes and Grid provisioning settings

Queue scaling only helps if Kubernetes can create the browser capacity Grid expects. Selenium Grid’s CLI reference describes Kubernetes options for the API endpoint, browser image-to-capability mappings or Job templates, namespace, service account, and image pull policy. Review these alongside cluster permissions and image availability before relying on autoscaling.

  • Confirm the target workload or Job template uses the intended browser image and capability stereotype.
  • Confirm the Grid GraphQL endpoint is reachable from the KEDA operator and that authentication, if enabled, is configured securely.
  • Ensure the workload’s actual --max-sessions or SE_NODE_MAX_SESSIONS agrees with nodeMaxSessions in its trigger.
  • Set the replica ceiling according to available cluster capacity rather than assuming queued demand can always be served immediately.

DIY alternative: take a website screenshot with an API

If you need a website screenshot rather than a Selenium test session, ScreenshotNeo offers a screenshot API and MCP server for developers. Its one-request API is a separate option from operating a Selenium Grid pool.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup

One GET request returns an image or PDF; the example below saves the response as a WebP file. See the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie and consent banners are accepted like a visitor and removed along with supported newsletter popups and chat widgets; each cleanup step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and whether the request was billed.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents, including Claude, Cursor, and other MCP clients.
  • The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month, with no card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Consider Grid’s native Kubernetes session factory

Selenium Grid 4.41.0 introduces a different design: its Kubernetes session factory provisions one browser Pod per session request and removes that Pod when the session closes. Provisioning is described as part of Grid rather than a separate scaler configuration. Validate the feature and its Kubernetes configuration for the exact Grid release you deploy.

Decision point KEDA with persistent node workload Grid-native Kubernetes session factory
Provisioning unit Scales a browser-node workload from queue demand. Creates a browser Pod for each session request, then removes it when that session closes.
Configuration to maintain KEDA’s ScaledObject or ScaledJob settings must agree with Grid node and session settings. Provisioning is described as intrinsic to Grid; validate Kubernetes configuration for the deployed release.
Scale behavior Queue-driven replicas or Jobs; ScaledJob behavior varies by strategy. Per-session ephemeral browser Pod lifecycle.
Evidence on performance, cost, or throughput No general workload benchmark establishes a best latency, cost, or throughput. No general workload benchmark establishes a best latency, cost, or throughput.

Use KEDA when its queue-aware scaler and node-pool model fit your existing operations. Consider the native session factory when per-session ephemeral Pods and Grid-managed provisioning better match the lifecycle you want. Neither approach is established as universally faster or cheaper; compare them under representative concurrency and browser images.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot common scaling problems

Queued sessions do not cause enough nodes to appear

Check that the trigger points to the reachable Grid GraphQL URL, its capability filters match the queued requests and node stereotypes, and KEDA can authenticate if Grid requires it. Then compare nodeMaxSessions with the node’s real --max-sessions or SE_NODE_MAX_SESSIONS setting.

More ScaledJobs appear than expected

If the ScaledJob uses the accurate or eager strategy, check whether includeOngoingSessions is set to "false". Confirm the setting against the KEDA release in use.

New capacity cannot be scheduled

Review the maximum replica bound, browser resource requests, available cluster capacity, image availability, namespace, service account, API endpoint, and image pull policy. A scaler cannot provide usable sessions if Kubernetes cannot place or start the configured browser workload.

Tests fail during scale-down

Do not treat scaling policy as a substitute for node draining and session lifecycle management. Review how the deployment handles active sessions before allowing nodes to be removed; SeleniumHQ’s 2022 discussion notes that arbitrary scale-down can cause connection failures for tests still using a node.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan for capacity, reliability, and cost

Set bounds with per-browser resource requests and other cluster workloads in view. Queue-aware scaling reacts to waiting demand, but it cannot promise immediate capacity if the cluster has no room to schedule new nodes. The cited KEDA and Selenium materials do not establish a universal node count, cost saving, latency, or throughput figure. Use a representative workload test to choose limits and compare the persistent-node and per-session-Pod lifecycles.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.