Browser test suites get slow as they grow. Running tests in parallel across many browsers cuts the wait from an hour to minutes, and Selenium Grid is the standard way to do that for WebDriver-based tests in Java, Python, C#, JavaScript and other languages. Hosting the Grid on your own VPS servers gives predictable cost and full control over browser versions, network access to staging environments and test data.
Grid 4 Architecture
Selenium Grid 4 is made of components: a Router (entry point), a Distributor (assigns sessions to nodes), a Session Map, a New Session Queue, an Event Bus, and Nodes that run browsers. You can run them in three ways:
| Mode | Description | Use |
|---|---|---|
| Standalone | All components and a node in one process | Small teams, one server |
| Hub and node | Hub runs the central components; nodes register with it | Most multi-server setups |
| Distributed | Each component runs separately | Large grids needing fine-grained scaling |
Running with Docker
The official docker-selenium images package browsers, drivers and the Grid at matching versions. A typical hub-and-node layout uses a selenium/hub container and selenium/node-chrome, node-firefox or node-edge containers, connected through the event bus ports (4442 and 4443) with clients connecting to port 4444. Pin image tags to specific versions so browser upgrades happen when you choose. Give browser containers enough shared memory (the project recommends a larger --shm-size, such as 2 GB, for Chrome) to avoid crashes.
Sessions per Node
Each browser session uses CPU and memory. A practical starting point is about one concurrent session per vCore with 1–2 GB of RAM per session, then adjust using real measurements. Set the node's maximum sessions explicitly rather than relying on defaults. Too many sessions on one node make every test slower and introduce timeouts that look like flaky tests.
Dynamic Grid
With the Docker node mode ("dynamic grid"), the Grid starts a fresh browser container for each session and removes it afterwards. Every test gets a clean browser, and you can offer several browser versions. It needs access to the Docker daemon, which is root-equivalent, so isolate that server and keep it private.
Securing the Grid
- An open Grid lets anyone run browsers on your servers, which can be abused to reach internal networks. Never expose port 4444 to the internet without protection.
- Keep nodes and the hub on a private network; let CI reach the Grid over VPN or private networking.
- If remote access is needed, enable the Grid's basic authentication options and put it behind HTTPS with Nginx, plus an IP allow list.
- Do not use production credentials in tests; use dedicated test accounts.
Connecting CI
Tests create a RemoteWebDriver (or the equivalent in your language) pointing at http://grid-host:4444 with the desired browser options. Run tests in parallel with your test framework's settings, matched to the Grid's total session capacity. Session requests above capacity wait in the queue; set a sensible queue timeout so CI fails clearly rather than hanging. See our Jenkins guide and CI/CD infrastructure guide.
Video, Logs and Debugging
docker-selenium supports recording video of sessions, which is invaluable for understanding failures in headless runs. Save screenshots and browser console logs on failure, keep videos only for failed tests to save disk, and clean old recordings automatically. The Grid UI at /ui shows nodes, sessions and the queue, and can show live sessions through VNC where enabled.
Making Tests Stable
- Use explicit waits for conditions, never fixed sleeps.
- Prefer stable locators such as IDs, data attributes or accessible names.
- Make tests independent, with their own data, so they can run in any order and in parallel.
- Set page load and script timeouts to fail fast on hung pages.
- Restart nodes or use dynamic grid to avoid state building up in long-running browsers.
Selenium Grid or Playwright?
If you are starting a new test suite, Playwright offers built-in parallelism and auto-waiting without a Grid (see our Playwright testing guide). Selenium Grid remains the right choice for existing WebDriver suites, for teams using many languages, and for organisations standardised on the W3C WebDriver protocol. For non-testing automation, see our browser automation guide.
Monitoring
Watch the session queue length and wait time, node availability, CPU and memory per node, and test failure rates by browser. A growing queue means you need more nodes; rising timeouts with no queue often mean nodes are overloaded. The Grid exposes status endpoints and GraphQL queries you can poll from monitoring.
Sizing
| Setup | Suggested plans |
|---|---|
| Standalone grid, a few parallel sessions | 4 vCores / 16 GB |
| Hub plus two Chrome/Firefox nodes | 2 vCores / 8 GB hub, 2 × 4 vCores / 16 GB nodes |
| Large suites with many parallel sessions | Hub plus several 8 vCore / 32 GB nodes |
The hub itself is light; nodes need the CPU and memory.
Example: A QA Team
A QA team runs a Selenium Grid hub on a 2 vCore / 8 GB VPS and three 8 vCore / 32 GB nodes on a private network, each set to eight Chrome or Firefox sessions. Jenkins runs the regression suite with 24 parallel threads, videos are kept only for failed tests for seven days, and the full suite finishes in 15 minutes instead of two hours.
Common Mistakes
- Exposing port 4444 to the internet.
- Too many sessions per node, causing timeouts.
- Default shared memory, causing Chrome crashes in Docker.
- Unpinned images that upgrade browsers unexpectedly.
- Tests sharing data and failing when run in parallel.
In Short
Run Selenium Grid with pinned Docker images, size sessions to vCores and memory, keep the Grid private, record failures, make tests independent and scale by adding nodes.
SkyRainCloud Plans for This Workload
Browsers are the cost: plan roughly one concurrent session per vCore with enough RAM per browser. A 4 vCore / 16 GB node runs about four parallel Chrome sessions comfortably; add nodes for more parallelism.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.