Apache Internal Request for PHP Service Data Script

I have a PHP page that receives its content by sending an HTTP request to another site on the same server using file_get_contents. Both sites work in Apache 2, which calls PHP using suPHP (which is FastCGI, right?)

How significant is the overhead for this call? Does Apache do a lot of processing before sending a request to PHP?

An alternative way to make a call would be for the first site exec('php /the/other/script.php some parameters'). Will it be faster or the overhead of creating a process more than going through Apache?

+3
source share
2 answers

Apache over head will depend on what is configured for this site host, e.g. https, htaccess checks, rewrites, etc. These things can add up. Now I don’t think that it would be too hard, but you will have time to force an answer, which, depending on the nature of the external calls, can be significant in some situations.

With that said, I see no problem making calls through apache. But I really think that since you are offering to expose php directly, it would be better. I think it is possible that reading on SOA in general can help you get an idea of ​​what is best to implement.

+1
source

Unfotunatly PHP cgi, alot of performace, . - PHP apache modul

0

Source: https://habr.com/ru/post/1726150/


All Articles