Does the program use Curl to invoke the local interface path, and will it consume the server's HTTP request?

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.