Rayrun
โ† Back to Discord Forum

Playwright Thread Count

connnnnnnorlposted in #help-playwright
Open in Discord
connnnnnnorl

Hi all ๐Ÿ‘‹

My general question is: I can see from the documentation that playwright launches a separate process for each worker specified in your playwright config. However, its not as clear to me what happens when you enable fullyParallel in the playwright config. How does playwright distribute the work across the worker processes you've specified? Would files with a bunch of tests dramatically increase the thread count on a machine?

For more context:

I'm currently running into an issue on a CI machine where playwright is launching a thread count that is exceeding the artificial limit set on the machine, causing it to restart. The number of workers I launched is set to 20 and fullyEnabled is set to true in my playwright config. The thread count is also over 4000. I know chrome is a thread happy process, but does that sound like an abnormal amount of threads being launched?

We've had these configurations set on the machine for a few months without seeing the thread issue pop up. So i'm wondering if fullyEnable could be causing it to spike in test files that have a lot of tests inside.

Specs on the CI machine is:

Memory: 68GB CPUS: 36

Thanks in advance for any help / guidance!

This thread is trying to answer question "How does playwright distribute the work across the worker processes you've specified? Would files with a bunch of tests dramatically increase the thread count on a machine?"

1 reply

Might assert the nomenclature is a bit muddied. I would think a worker as defined by PW is more a child process, or effectively a browser instance from reading the docs. Think a general rule of thumb is 1/4 to 1/2 of your cpus depending on the workload each child process may introduce. While each child process may easily have 100's of threads.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.