-
Notifications
You must be signed in to change notification settings - Fork 1
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
Multi-threading headless API responses? #33
Comments
Are the individual CPU cores used at/near 100% when failure occurs? (if so, multithreading code won't be a solution) |
Thanks. The remote formprint-dev server only serves the XForms to your local app(s), right? |
I am less confident the multi-threading approach will work here. We may not be able to run puppeteer in a worker_thread (am getting Also found this that may possibly be interesting: https://github.com/thomasdondorf/puppeteer-cluster |
|
Old PDF CodeCPU core usage is similar to the previous tests. 8 cores - all used by Enketo (cluster workers) (
|
Linux server findings:
|
script used (and a variant using a record, sent to #!/bin/sh
TIMEFORMAT='It took %R seconds.'
time {
for i in {1..12}
do
curl --user enketorules: -d "server_url=http://localhost:3000&form_id=LabsReconciliation&ecid=a" http://localhost:8005/oc/api/v1/survey/view/pdf &
pids[${i}]=$!
done
for pid in ${pids[*]}
do
wait $pid
done
}
|
Screen.Recording.2023-09-07.at.9.20.18.AM.movI'm using 4 threads/requests in this test. |
@MartijnR what is the error code you receive if you send more requests than Enketo can handle? |
I'm getting a HTTP status code 408 (Request Timeout) response with body:
|
https://www.digitalocean.com/community/tutorials/how-to-use-multithreading-in-node-js
The text was updated successfully, but these errors were encountered: