Is this performance effective (on a Windows Server) to execute tasks in .exe lauched by a php script?
I’m a C# .Net coder and find it way more faster/easier to code directly in C# my backend SQL and 3rd party API functions that requires security, and I would like to know if, on long term, it is good or bad for my website performance to do so.
Will launching executables create a delay in the script, or does the performance (php vs exe) depend on the length of the task to accomplish?
[Edit]
Sorry for the worthless question. I’ll search for similar threads on SO and paste some links.
It is “performance effective” to code the frontend in PHP, and to code the business logic in a more efficient language (which could be C# in your case). This is done often in an SOA (service oriented architecture), which is much more scalable than your idea of doing an
execon the same machine, because it allows physical distribution of the workload, but this is not viable for you, apparently.Your question is not very clear about what you want to
exec, and especially whether you need the result in a synchronous way, but on a Unix-like machine you could launch the execution in background by terminating the command with a&, and anyhow you will also need to redirectstdinandstderr(see the manual for more information).There is no security risk I know of, as long as you completely sanitize your input, and propery escape your exec parameters.
The timeout mechanism of the web server and the mechanisms which kill a child when a parent is killed will prevent damage by hanging processes, unless they are sent to background. You will probably need a limiting mechanism for the number of concurrent
execed processes, if they are sent to background.