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.