开发者

fsockopen php performance

开发者 https://www.devze.com 2023-03-23 02:26 出处:网络
I was writing a program that will retrieve information about a particular IP or domain name from WHOIS servers establishing socket connection using php. I used fsockopen() function to establish the so

I was writing a program that will retrieve information about a particular IP or domain name from WHOIS servers establishing socket connection using php. I used fsockopen() function to establish the socket connection which actually creates a file. It's working perfectly. But this program was written for a particular purpose and had to make 15-20 connections at a time, which results in overhead of the server and also degrades the performance. Is there any alternative solution which can enhance the performance and moreover will not require the file storage as it is not necessary other than just a开发者_如何学Cccessing the data once? If anyone has some idea please share.


maybe asynchronous curl (eg rolling curl) is much better so you can handle many connections parallel or any ajax solution


Rolling curl is good or use the curl_multi_* funnctions: http://www.php.net/manual/en/function.curl-multi-exec.php

0

精彩评论

暂无评论...
验证码 换一张
取 消