Symptom: Why does the phprpc response time increase greatly due to CURL under the same IP address in ThinkPHP?

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

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.