Question about using multiple browsers with Python

trishula

BANNED
Joined
Feb 11, 2026
Messages
23
Reaction score
5
Hello, I am using multiple browsers with Python Selenium, and I am using Chrome for this. Chrome consumes a lot of RAM and GPU resources. My goal is to be able to use multiple browsers on a low-RAM Ubuntu VDS without crashing the system. I have to use a browser on my system; incognito mode does not work for me.
 
Hello, I am using multiple browsers with Python Selenium, and I am using Chrome for this. Chrome consumes a lot of RAM and GPU resources. My goal is to be able to use multiple browsers on a low-RAM Ubuntu VDS without crashing the system. I have to use a browser on my system; incognito mode does not work for me.
Instead of running entire instances for each session, you might want to optimize Chrome. You may try headless mode, turning off pictures and extensions, decreasing the resolution, and restricting GPU use with launch flags. Also, think about utilizing Chromium or other lightweight browsers, or remote browser containers to lower the amount of RAM they need. This manner, you can run more than one session on a low-RAM Ubuntu VDS without crashing the machine.
 
If you're stuck with a low-RAM VDS, your best bet is to switch to Playwright instead of optimizing Selenium

The main reason most people (including me) do that is because of the way browser sessions are handled by Selenium and Playwright.

Selenium creates an OS Level browser process for each instance.

Playwright has something called "BrowserContexts" - which allow it to run several chrome instances on the same OS level binary.

If you're comparing against Selenium, this amounts to about 5x reduction in usage. So in the same RAM space you can run 15-20 BrowserContexts as against Selenium's 3-4 browser instances.

There are other benefits too when you look under the hood.

Selenium uses Web Driver which then interacts with the browser. Playwright used Websockets so it interacts directly rather than having a Web Driver process in between

There are a host of other benefits too and I can take you through them if you'd like. But the base recommendation is the same, switch to Playwright and use BrowserContexts
 
Instead of running entire instances for each session, you might want to optimize Chrome. You may try headless mode, turning off pictures and extensions, decreasing the resolution, and restricting GPU use with launch flags. Also, think about utilizing Chromium or other lightweight browsers, or remote browser containers to lower the amount of RAM they need. This manner, you can run more than one session on a low-RAM Ubuntu VDS without crashing the machine.
Chrome is heavy, especially when running multiple Selenium instances. On low-RAM Ubuntu VDS setups, a few optimizations can make a big difference:


  • Run Chrome in headless mode (new headless is much lighter).
  • Disable GPU with --disable-gpu.
  • Disable images and unnecessary features (extensions, dev tools, etc.).
  • Use --no-sandbox and --disable-dev-shm-usage on small VPS setups.
  • Lower the shared memory usage or increase swap if possible.

You could also test Chromium instead of full Chrome, or even Firefox with Geckodriver, sometimes it behaves better under constrained RAM.


If you’re running many sessions at once, consider limiting concurrency or using lightweight containers to isolate and control memory usage.
If you're stuck with a low-RAM VDS, your best bet is to switch to Playwright instead of optimizing Selenium

The main reason most people (including me) do that is because of the way browser sessions are handled by Selenium and Playwright.

Selenium creates an OS Level browser process for each instance.

Playwright has something called "BrowserContexts" - which allow it to run several chrome instances on the same OS level binary.

If you're comparing against Selenium, this amounts to about 5x reduction in usage. So in the same RAM space you can run 15-20 BrowserContexts as against Selenium's 3-4 browser instances.

There are other benefits too when you look under the hood.

Selenium uses Web Driver which then interacts with the browser. Playwright used Websockets so it interacts directly rather than having a Web Driver process in between

There are a host of other benefits too and I can take you through them if you'd like. But the base recommendation is the same, switch to Playwright and use BrowserContexts
On low-RAM Ubuntu VDS, running multiple full Chrome instances will almost always choke the system. Instead of just tweaking flags, you might want to rethink resource allocation:


  • Limit concurrent sessions instead of launching all at once
  • Use lightweight window size (smaller resolution reduces memory)
  • Disable images, CSS animations, and unnecessary features
  • Add swap space if possible
  • Monitor memory per instance and cap usage

Sometimes stability comes more from managing concurrency than trying to strip Chrome down completely.
Running multiple browsers with Python is pretty common, especially for automation or scraping setups, but the important part is isolation. Using separate browser profiles or containers (instead of just multiple windows) prevents cookies, sessions, and fingerprints from overlapping. Also, managing each browser instance through independent drivers or rotating proxies helps keep the environments clean. Once you treat each browser as its own isolated session rather than simply “opening many browsers,” stability and reliability improve a lot.
Running multiple browsers with Python is definitely doable, but stability usually depends on how the sessions are managed. Instead of just launching many browser windows, using separate user profiles or containerized environments for each instance keeps cookies, local storage, and fingerprints isolated. Pairing each instance with its own proxy and controlling them through independent driver sessions (Selenium/Playwright) also helps prevent cross-session conflicts and random logouts. Once each browser runs as a fully isolated environment, scaling to many parallel instances becomes much more reliable.
Thank you for your valuable answers. This information will be useful for my work. I would be happy to hear any additional suggestions you may have.

My intention is to perform operations with different accounts using a multi browser. My goal is to achieve as many results as possible with minimal RAM usage, and to obtain better results on more powerful VDSs. If I can push the limits on a low spec VDS, the results on high spec VDSs will be completely satisfactory.
 
Back
Top