Using curl to send data to the interface, there is a long wait for the corresponding phenomenon, how to solve.

Source: Internet
Author: User

Background: Java provides an address that I use to access this address in my local browser (the environment's Wamp Server), and quickly, very quickly, to get the data.
Now go to production environment, I use curl to access this address, send data, complete, there is a big problem.

Specific problem: Click on the page with curl to the address sent, I get the data returned, I think it will be as fast as my local test, non-also, some fast, some slow, some slow to die, I use Firebug a look, the problem is in waiting for the corresponding time is very long, such as.

Think: I think the problem should not be in Java, after all, the browser access to get the data is very fast, then the problem can only appear in PHP, is using curl out of the problem? Or what is wrong with the server configuration? Please give us a lot of advice.

Reply content:

Background: Java provides an address that I use to access this address in my local browser (the environment's Wamp Server), and quickly, very quickly, to get the data.
Now go to production environment, I use curl to access this address, send data, complete, there is a big problem.

Specific problem: Click on the page with curl to the address sent, I get the data returned, I think it will be as fast as my local test, non-also, some fast, some slow, some slow to die, I use Firebug a look, the problem is in waiting for the corresponding time is very long, such as.

Think: I think the problem should not be in Java, after all, the browser access to get the data is very fast, then the problem can only appear in PHP, is using curl out of the problem? Or what is wrong with the server configuration? Please give us a lot of advice.

You can take a few more servers to test, with the elimination method.
It is normal for me to return speed after I have collected the data myself.

Similar remote calls can refer to Soap

It may be related to network conditions. 1, check the server to the Java Service network of the machine, simple test using ping; 2, look at the DNS configuration of the server.

  • 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.