Symptom: the response time of phprpc increases greatly due to CURL under the same IP address. why? For example, curl for different IP addresses: rpc service response time: 0.005 seconds {code ...} curl under the same IP address: rpc service response time: 0.610 seconds {code ...} symptom: the response time of phprpc increases greatly due to CURL under the same IP address. why? For example,
Curl for different IP addresses: rpc service response time: 0.005 seconds
PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.005
Curl under the same IP address: rpc service response time: 0.610 seconds
PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.610
Reply content: symptom: CURL under the same IP address causes a huge increase in the response time of phprpc. why? For example,
Curl for different IP addresses: rpc service response time: 0.005 seconds
PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.005
Curl under the same IP address: rpc service response time: 0.610 seconds
PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.610
I copied the answer to a question that I answered before. let's take a look at the specific time consumption and then optimize it accordingly?
Https://segmentfault.com/q/1010000004701668/a-1020000004703480
Use the CRUL command to analyze the time used by the request details.
Curl-o/dev/null-s-w % {http_code }:%{ time_namelookup }:%{ time_redirect }:%{ time_pretransfer }:%{ time_connect }: % {time_starttransfer }:%{ time_total }:%{ speed_download} www.baidu.com
This example analyzes the parameters of a Baidu request: http status code, DNS resolution time, redirection time, time from start to preparation for transmission, TCP connection time, start transmission time, total time, download speed!
Detailed can see CURL documentation: https://curl.haxx.se/docs/manpage.html