If you want to use the cURL interface to send data, it takes a long time to wait. How can this problem be solved.

Source: Internet
Author: User
Background: java provides an address. I use my local browser (WAMPServer IN THE ENVIRONMENT) to access this address. It is very fast and quick to get data. Now go to the production environment, I use cURL to access this address, send data, and then there is a big problem. Question: On the page...

Background: java provides an address. I use my local browser (WAMP Server in the environment) to access this address. It is very fast and quick to get data.
Now go to the production environment, I use cURL to access this address, send data, and then there is a big problem.

Specific problem: Click here on the page and send it to the address using cURL. I get the returned data. I thought it would be as fast as I tested locally, neither nor, some would be fast, and some would be slow, some of them are slow to death. I used Firebug to check that all the problems occurred are waiting for a long time, for example.

Thinking: I think the problem should not be in java. After all, it is very fast to access the data through a browser, so the problem can only occur in PHP. Is it a problem with cURL? Or is there any problem with server configuration? Please give more comments.

Reply content:

Background: java provides an address. I use my local browser (WAMP Server in the environment) to access this address. It is very fast and quick to get data.
Now go to the production environment, I use cURL to access this address, send data, and then there is a big problem.

Specific problem: Click here on the page and send it to the address using cURL. I get the returned data. I thought it would be as fast as I tested locally, neither nor, some would be fast, and some would be slow, some of them are slow to death. I used Firebug to check that all the problems occurred are waiting for a long time, for example.

Thinking: I think the problem should not be in java. After all, it is very fast to access the data through a browser, so the problem can only occur in PHP. Is it a problem with cURL? Or is there any problem with server configuration? Please give more comments.

You can take several more servers for testing and use the exclusion method.
I can return data at a normal speed after collecting the data myself.

For more information about similar remote calls, see SOAP.

It may be related to network conditions. 1. Check the network from the server to the machine of the java service and use ping in a simple test. 2. Check 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.