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

Confirm multi-core support with data per test #10

Open
zarianec opened this issue Mar 21, 2022 · 7 comments
Open

Confirm multi-core support with data per test #10

zarianec opened this issue Mar 21, 2022 · 7 comments
Assignees

Comments

@zarianec
Copy link
Contributor

The probe server must utilize all available CPU cores.

Yes, I wanted to use throng for clustering but it means that every single probe will create multiple separate ws clients.

Originally posted by @zarianec in jsdelivr/globalping#37 (comment)

Alternative by Patryk https://nodejs.org/docs/latest-v12.x/api/worker_threads.html

@jimaek
Copy link
Member

jimaek commented Apr 28, 2022

each command execution spawns a separate process,
the master process just handles the connection to the server and passes data back and forth
so this task can be closed imo
as long as we spawn a new process per command its done

@patrykcieszkowski
Copy link
Contributor

each command execution spawns a separate process,
the master process just handles the connection to the server and passes data back and forth
so this task can be closed imo
as long as we spawn a new process per command its done

@zarianec It might make sense to run output parsers in worker threads, but I wouldn't worry about HTTP I/O, and ofc we don't have to worry about native commands since they run on separate processes already.

@jimaek
Copy link
Member

jimaek commented May 16, 2022

Note to correctly handle native HTTP tests as well that dont call a binary jsdelivr/globalping#91

@jimaek jimaek assigned patrykcieszkowski and unassigned zarianec Jun 13, 2022
@patrykcieszkowski
Copy link
Contributor

@jimaek as explained - it’s done

@jimaek
Copy link
Member

jimaek commented Jun 13, 2022

Even HTTP (got)?

@patrykcieszkowski
Copy link
Contributor

patrykcieszkowski commented Jun 13, 2022

HTTP is an I/O request - it’s asynchronous like web sockets are. It’s not recommended to run I/O requests on separate threads, since native aync mechanism is much more performant. I’ve also proven this on my benchmark test cases.

https://github.com/patrykcieszkowski/node-io-benchmark

https://nodejs.org/api/worker_threads.html#worker-threads

@jimaek jimaek assigned zarianec and unassigned patrykcieszkowski Jun 13, 2022
@jimaek
Copy link
Member

jimaek commented Jun 13, 2022

@zarianec let us know what you think and if the task can be closed

@jimaek jimaek changed the title Add multi-core support Confirm multi-core support with data per test Jul 14, 2022
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

4 participants