Title
In our program, fairies use a lot of curl for internal program interface calls, whether such a schema will affect the performance of the server, because an HTTP request, will let the server restart a process of PHP, Is it a good choice to split the function module by calling Curl in the system multiple times to get the data?
Reply content:
Title
In our program, fairies use a lot of curl for internal program interface calls, whether such a schema will affect the performance of the server, because an HTTP request, will let the server restart a process of PHP, Is it a good choice to split the function module by calling Curl in the system multiple times to get the data?
Yes, Curl's request for local HTTP also completes an entire HTTP process, and the process required to invoke the request from the outside is the same, such as what you say requires restarting a PHP process, and so on. Only from the local call without the flow of your external network, which gives the feeling is to grasp their own data.
The project is small, need to call the place is not too many times this approach can be used as a simple method of splitting, but the frequent call after the first is the success of the program's structure becomes chaotic and difficult to maintain, followed by increasing the cost of the server itself. Services and data are local it is not necessary to do this, if it is in the same language, it will get the processing data of this part of the code is packaged together, if not the same language to see if you can directly from the database to get data.
is definitely occupied, intranet requests are only a few steps down the regular HTTP request. I think you can consider using WebService or RPC in this case.