Home > Backend Development > PHP Tutorial > Phenomenon: CURL under the same IP under ThinkPHP causes phprpc response time to increase significantly. What is the reason?

Phenomenon: CURL under the same IP under ThinkPHP causes phprpc response time to increase significantly. What is the reason?

WBOY
Release: 2016-07-06 13:53:34
Original
1008 people have browsed it

Phenomena: CURL under the same IP causes phprpc response time to increase significantly. What is the reason?

For example,

curl under different IPs: rpc service response time 0.005 seconds

<code>PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.005
</code>
Copy after login
Copy after login

curl under the same IP: rpc service response time 0.610 seconds

<code>PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.610
</code>
Copy after login
Copy after login

Reply content:

Phenomena: CURL under the same IP causes phprpc response time to increase significantly. What is the reason?

For example,

curl under different IPs: rpc service response time 0.005 seconds

<code>PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.005
</code>
Copy after login
Copy after login

curl under the same IP: rpc service response time 0.610 seconds

<code>PHPRPC Client 3.0 for PHP" - 127.0.0.1:9000 200 0.610
</code>
Copy after login
Copy after login

I copied the answer to a question I answered before. Let’s check the specific time consumption first and then optimize it accordingly, right?
https://segmentfault.com/q/1010000004701668/a-1020000004703480

Use the CRUL command to simply analyze the time taken by 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 is to analyze various 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!

For details, please see the CURL documentation: https://curl.haxx.se/docs/manpage.html

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template