On my Node server there are occasions where a Python script needs to be executed (using execFile()). I've definitely noticed a bottleneck in performance and I've been thinking that perhaps the Python process is blocking the io, even though execFile should be executing on a separate process. Another solution I've tried is clustering, which has improved speeds slightly, but will still stall the server.It could also be how I'm executing the script. Pseudocode:Promise.all(arr.map(v =>{ let r = await execFile('file.py',[args, here]) }))The array being mapped could potentially have 100+ objects, so the python script is being executed that many times. However, shouldn't the promisifying of the execFile not block the io?Thanks!
Submitted January 13, 2019 at 04:05AM by JK33Y
No comments:
Post a Comment