Don’t run a long Puppeteer task synchronously in a Rails controller. Enqueue it as a background job, run that job in a live worker, and limit browser concurrency to what the container’s measured memory and CPU can support. Then diagnose container exits and Chromium launch failures separately: an OOM kill, a small /dev/shm, missing browser dependencies, and unreaped child processes need different fixes.
Why Puppeteer can take down a Rails container
A Rails controller request and a browser automation task have different lifetimes. When a controller launches Chromium and waits for a screenshot, scrape, or render, the browser competes for resources with the Rails web process. If memory pressure triggers an out-of-memory event, Docker documents that the kernel kills processes in the container by default. The immediate symptom may be a container exit, a failed request, or both; the cause needs to be confirmed from the container’s termination information and resource usage.
Moving browser work to a background queue keeps it out of the HTTP request-response cycle, but it does not make the work free or automatically isolated. A worker in the same container can still compete with Rails for memory and CPU. A separate worker service can provide a stronger resource boundary, at the cost of additional deployment and queue operations.
Rails’ Active Job guide describes background jobs as a way to move long-running or non-critical work out of the request-response cycle. The current guide documents Solid Queue as the default starting with Rails 8.0; older applications or applications configured differently may use another adapter. Check your actual Rails version and config.active_job.queue_adapter before adopting a setup. Rails Active Job Basics; Docker resource constraints.
#1 Best Overall
- Compatible with Nintendo Switch 2’s new GameChat mode
- Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
- Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
- Built-In Mic: The built-in microphone lets others hear you clearly during video calls
- Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
Move browser work out of the controller
Enqueue a job and return promptly
Keep the controller responsible for validating and authorizing the request, enqueueing work, and returning an accepted response or job identifier. Pass serializable identifiers and arguments to the job rather than browser objects or other live resources.
class BrowserTaskJob < ApplicationJob
queue_as :browser
def perform(record_id)
record = Record.find(record_id)
# Invoke the browser integration here and persist the result.
# Ensure browser resources are closed on both success and failure.
end
end
class BrowserTasksController < ApplicationController
def create
job = BrowserTaskJob.perform_later(params.require(:record_id))
render json: { job_id: job.job_id }, status: :accepted
end
end
This is an architecture sketch, not drop-in code for a particular application: it does not define your browser wrapper, authorization policy, queue adapter, result persistence, or job-status endpoint. The client needs a separate way to learn whether the job completed and to retrieve its result.
Make sure a worker is actually running
Enqueuing is only half the system. The configured backend must accept the job, and a worker must be running to process it. For Solid Queue, Rails documents starting workers with bin/jobs start; its worker configuration includes thread and process counts. Other adapters, such as Sidekiq or GoodJob, have their own service and configuration requirements. Consult the guide for your adapter and deployment rather than assuming a web process will run queued jobs.
The in-process async adapter is not the same as a durable independent worker: Rails documents that its jobs are held in memory and outstanding work can be lost if the process crashes or the machine resets. Choose a backend according to the reliability your task needs. Rails Active Job Basics.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- Compatible with Nintendo Switch 2’s new GameChat mode
- Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
- The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
- C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
- The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
Close browser resources and reap child processes
Scope the browser lifecycle to the job. Close pages and the browser in cleanup paths on both success and failure, and make sure Chrome’s child processes are reaped. Puppeteer’s Docker guidance recommends an init process, such as Docker’s --init, to manage child processes. Process cleanup helps avoid accumulating stray processes; it does not solve an undersized memory limit. Puppeteer Docker guide.
Choose where the browser worker runs
| Architecture | What it helps with | Trade-off |
|---|---|---|
| Browser work in the controller request | Can return the browser result in the same request when the client truly needs it synchronously. | Browser runtime and resource use affect request latency and the web process; long work can outlast request or platform limits. |
| Queued worker in the same container | Decouples browser task duration from the HTTP response and keeps controller code thin. | Rails and Chromium still share the container’s CPU and memory budget; a worker must be started and monitored. |
| Separate browser-worker service | Allows browser workload resources and concurrency to be managed separately from the web service. | Adds deployment, queue, monitoring, and service-configuration work. |
These are architectural trade-offs, not measured performance results. If the user needs a browser result before the HTTP response, synchronous execution may be necessary, but it still needs a realistic request budget and resource limits. Otherwise, prefer a queue and worker; isolate the worker when shared-container contention remains a problem. Rails’ queue model and Puppeteer’s Docker requirements make the relevant operational differences explicit. Rails Active Job Basics; Puppeteer Docker guide.
Build and run Chromium with Docker requirements in mind
Installing the Puppeteer package alone does not guarantee that a container can launch Chrome. The browser needs compatible Linux libraries, a workable sandbox configuration, and writable locations for its profile and cache. Puppeteer’s official Docker image includes Chrome for Testing and its dependencies, runs in sandbox mode, and its documented setup requires the SYS_ADMIN capability. Follow the current image guidance rather than copying a capability setting into a different image or runtime without understanding its security implications. The guide also recommends an init process for child-process management. Puppeteer Docker guide.
If you build a custom image, check the browser dependencies, browser/image compatibility, user permissions, sandbox setup, and writable Chrome configuration, cache, and user-data paths. In a read-only container, explicitly provide writable locations where Chrome needs them. Use the troubleshooting guide for the error you actually see; a generic flag change can obscure the real cause. Puppeteer troubleshooting.
Rank #3
- 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
- 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
- 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
Set browser concurrency from measurements
Do not assume one browser job per worker thread is safe, or copy a concurrency number from another deployment. Each concurrent browser task adds workload alongside the Rails server and any other processes in the container. Start conservatively, observe memory and CPU during representative jobs, then adjust worker threads, processes, or per-job concurrency. Solid Queue exposes worker thread and process configuration and per-job concurrency controls, but the right values depend on the application, pages, and container limits.
- Measure under the heaviest browser pages and task patterns your application supports, not only a trivial page.
- Watch total container usage while Rails requests and browser jobs run together.
- Reduce simultaneous browser jobs if usage approaches the configured memory limit or CPU saturation makes work unstable.
- Increase a resource limit or move browser work to a separate service only after evidence points to resource pressure.
Docker’s Linux CLI memory statistic subtracts cache usage, so interpret docker stats accordingly. A single displayed number is not a complete explanation of an exit; pair it with the configured limit and the container’s exit or OOM evidence. Docker container stats; Docker resource constraints.
Diagnose the failure before changing Chromium flags
Container exited or was killed under memory pressure
- Check the container or hosting platform’s termination reason and exit information; inspect kernel or platform OOM events where available.
- Check the configured memory limit and observe usage with
docker statswhile reproducing representative browser jobs. - If evidence points to memory pressure, lower browser-job concurrency, increase the container’s memory budget, or isolate browser work in a separately resourced worker.
Docker’s default behavior is to let the kernel kill processes in a container when an OOM error occurs. Do not treat a browser launch flag or an init process as a substitute for a sufficient memory budget. Docker resource constraints; Docker container stats.
Chromium fails to launch
Look for missing shared libraries, an incompatible browser image, sandbox or capability problems, incorrect user permissions, or unwritable profile and cache paths. Check the specific Chromium error and the image’s configuration. Puppeteer’s troubleshooting guide also describes errors such as spawn ENOMEM and chrome_crashpad_handler: --database is required; the strings alone do not prove that the whole container was OOM-killed. Puppeteer troubleshooting.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
- Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
- Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
- Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
- High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
Shared-memory errors or Chromium crashes
Puppeteer’s troubleshooting guide says Docker’s default /dev/shm size is 64 MB. That is a documented Docker default, not a guarantee for every host or runtime. If the observed failure indicates shared-memory pressure, Puppeteer documents --disable-dev-shm-usage as a workaround that directs those files to /tmp:
const browser = await puppeteer.launch({
args: ['--disable-dev-shm-usage'],
});
Use it as a targeted workaround, ensure /tmp is writable, and do not mistake it for more total container memory. If overall memory is the problem, address the memory budget or concurrency instead. Puppeteer troubleshooting.
Child processes accumulate
Configure a proper init process as PID 1 or run the container with Docker’s --init option, as Puppeteer recommends. This addresses child-process management; it is distinct from increasing memory or changing /dev/shm. Puppeteer Docker guide.
Work slows after the request returns
Some runtime platforms change CPU allocation after responding to a request. Puppeteer’s troubleshooting documentation gives Google Cloud Run as a specific example. Verify whether your own platform behaves this way before attributing post-response slowdown to a general Docker behavior. Puppeteer troubleshooting.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Best Value
- Compatible with Nintendo Switch 2’s new GameChat mode
- HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
- Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
- Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
- Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
Or skip the browser setup
If the goal is a website screenshot rather than custom browser interaction, ScreenshotNeo offers a screenshot API and MCP server. A single GET request can return an image or PDF; its cleanup options accept cookie/consent banners and remove 60+ known consent platforms, newsletter popups, and chat widgets before capture, with each step configurable. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 shots a month without a card; paid plans start at $5 for 3,000 shots. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Sign up for 1,000 free screenshots a month—no card required.
Frequently asked questions
Does putting Puppeteer in a background job guarantee the container will stay up?
No. A worker removes browser work from the controller’s request path, but jobs still consume resources. Concurrency and container limits must be set for the workload and checked against actual usage.
Should I always add --disable-dev-shm-usage?
No. Use it when shared-memory pressure is implicated in the failure. It redirects relevant files to /tmp; it does not raise the container’s total memory limit.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteIs Rails 8 required to use Solid Queue?
No. The Rails guide documents Solid Queue as the default starting with Rails 8.0, but applications may use other adapters. Verify the adapter configured in your application and follow its worker instructions.
Quick Recap
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.

