Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using more 5-10 browser instances in one time #92

Open
smmwsem opened this issue Feb 19, 2023 · 4 comments
Open

Using more 5-10 browser instances in one time #92

smmwsem opened this issue Feb 19, 2023 · 4 comments

Comments

@smmwsem
Copy link

smmwsem commented Feb 19, 2023

Hello. I have an issue with cursor when I'm using it on 5-10 parallels puppeteer instances. I just starting 5 workers in one time with puppeteer and see that cursor is lagging on each browser.

Look at example: https://gist.github.com/smmwsem/b34292ed98df0ed36e5a7cfa2058fb28

Just run main.js

You need to install dependencies:

  • puppeteer-screen-recorder

Try just one thread and five threads.

The main question is how to work with multiple browsers at the same time?

Thanks.

@Xetera
Copy link
Owner

Xetera commented Feb 20, 2023

Does your code behave the way you expect without ghost cursor? There's currently no explicit support for multiplexed browsers. There are quite a few random numbers involved in the path generation algorithm using Math.random so running multiple copies of it will probably get you slightly different results which could explain some of the lag.

Though I have to wonder why you need everything to line up exactly on each browser in the first place. If there's a reasonable usecase for what you want, the Math.random calls could be replaced with a seedable PRNG like mersenne twister.

But even with library support, you're going to have to do some sort of synchronization across workers to make sure they're all ready to go after each page load. And I imagine your browsers are going to start drifting out of sync over time regardless.

@smmwsem
Copy link
Author

smmwsem commented Feb 20, 2023

@Xetera Hello, the code runs much slower when multiple browsers are launched.

Look how fast the cursor moves on 1 video and how slow the cursors move when 5 copies are running.

https://drive.google.com/file/d/1ss3Du4GEilL8izuKuTMEYUaAmpnPwg4l/view?usp=share_link
https://drive.google.com/file/d/1HHJNCQsuKMezjzxJ5Jedir3VR8mVuew2/view?usp=share_link

@smmwsem
Copy link
Author

smmwsem commented Feb 24, 2023

@Xetera hi. Do you have ideas about my issue? Thanks.

@JackSparrowf9
Copy link

Do you find solution for this, I run 3 4 browser instances and it lag, any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants