Jump to content
php.lv forumi

php multi CURL DNS kešošanas problēmas


malinens

Recommended Posts

Salabots!

 

Manuāli vajadzēja sainstalēt svaigāko Curl ar dependencies. Sanāca nonest visu PHP un uzinstalēt no jauna

 

 

Man radušās problēmas ar DNS kešošanu. Katru reizi name resolving notiek ap sekundi, kas nav normāli. Varbūt varat palīdzēt man noskaidrot, kāpēc tā?

 

no curl_getinfo():

 

[http_code] => 200

[redirect_count] => 0

[total_time] => 1.297915

[namelookup_time] => 0.99997

[connect_time] => 1.061014

[pretransfer_time] => 1.061031

[starttransfer_time] => 1.128962

 

 

Info par serveri:

 

PHP versija: 5.4.7

Apache 2.2.3

 

cURL support enabled

cURL Information 7.21.7

Age 3

Features

AsynchDNS Yes

Debug No

GSS-Negotiate Yes

IDN Yes

IPv6 Yes

Largefile Yes

NTLM Yes

SPNEGO No

SSL Yes

SSPI No

krb4 No

libz Yes

CharConv No

Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp

Host x86_64-redhat-linux-gnu

SSL Version OpenSSL/0.9.8b

ZLib Version 1.2.3

libSSH Version libssh2/1.2.7

 

Izmantoju ar curl_multi_exec()- paralēli tiek taisīti 4 pieprasījumi

 

Šis ar nepalīdz:

curl_setopt($aRequests[2], CURLOPT_DNS_USE_GLOBAL_CACHE, true);

curl_setopt($aRequests[2], CURLOPT_DNS_CACHE_TIMEOUT, 3600);

 

Esmu mainījis nameserverus (latnet, google utt.), bet nekā.

Arī esmu labojis /etc/hosts, bet php-curls vienalga veselu sekundi taisa name lookup.

 

Uz dev vides (Windows) viss ir OK

Edited by malinens
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...