globalping-probe icon indicating copy to clipboard operation
globalping-probe copied to clipboard

Confirm multi-core support with data per test

Open zarianec opened this issue 2 years ago • 7 comments

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 https://github.com/jsdelivr/globalping/issues/37#issuecomment-1073936379zz

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

zarianec avatar Mar 21 '22 14:03 zarianec

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

jimaek avatar Apr 28 '22 19:04 jimaek

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.

patrykcieszkowski avatar May 03 '22 12:05 patrykcieszkowski

Note to correctly handle native HTTP tests as well that dont call a binary https://github.com/jsdelivr/globalping/issues/91

jimaek avatar May 16 '22 11:05 jimaek

@jimaek as explained - it’s done

patrykcieszkowski avatar Jun 13 '22 13:06 patrykcieszkowski

Even HTTP (got)?

jimaek avatar Jun 13 '22 13:06 jimaek

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

patrykcieszkowski avatar Jun 13 '22 13:06 patrykcieszkowski

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

jimaek avatar Jun 13 '22 14:06 jimaek