Answer the question
In order to leave comments, you need to log in
How much performance degradation does node.js have when running it through php's exec() function?
Hello, I want to organize server rendering on
laravel +
vue.js every boot launches
<?php $result = exec('/usr/local/bin/node file.js')
that is, node.js does not hang as a server, but restarts each time. Answer the question
In order to leave comments, you need to log in
time node -p '(process.memoryUsage().heapUsed/1048576).toFixed(2)+"M"'
we run it on our server and admire the overhead from running a bare node... 3.71M
real 0m0,076s
user 0m0,064s
sys 0m0,012s
exec starts an external program. The performance of the node does not change in any way.
It depends on how to start rendering, but in general the node should not hang as a server, it renders everything once and ends, it's just a script.
Although if you re-render the entire project for every sneeze, then this is clearly not the best solution.
But rendering when the source data changes is normal.
Are you sure that this process is launched every time a request is made to the server, and is not compiled once after changes, like Laravel views?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question