PHP Classes
elePHPant
Icontem

Why not just set CURLMOPT_MAXCONNECTS ?

Recommend this page to a friend!

      Fast PHP CURL Multiple Requests  >  Fast PHP CURL Multiple Requests package blog  >  How to Retrieve Web P...  >  All threads  >  Why not just set CURLMOPT_MAXCONNECTS ?  >  (Un) Subscribe thread alerts  
Subject:Why not just set CURLMOPT_MAXCONNECTS ?
Summary:Improved stability is probably due to curl options
Messages:2
Author:Tofser
Date:2019-04-25 08:37:04
 

 


  1. Why not just set CURLMOPT_MAXCONNECTS ?   Reply   Report abuse  
Tofser - 2019-04-25 08:37:04
Why have you separated out the first url from the array - what do you think this is supposed to do? How does this differ from the way the other urls are added/executed?

I suggest your improved stability is not because of that, but because you have added the option to set CURLMOPT_MAXCONNECTS

curl_multi_setopt($mh, CURLMOPT_MAXCONNECTS, $n);

Did you try simply adding that option to the stock php.net code?

Or try removing it from your code to see if it is still "stable"?


see https://stackoverflow.com/questions/39032880/why-does-libcurl-calculate-4-times-the-number-of-added-easy-handles

  2. Re: Why not just set CURLMOPT_MAXCONNECTS ?   Reply   Report abuse  
riccardo castagna - 2019-06-24 17:12:54 - In reply to message 1 from Tofser
Thanks for the question and sorry for being late.

In my first version of this repository I had not included the option CURLMOPT_MAXCONNECTS. I included it later and it is not this option that optimizes the function.

You can try it yourself by removing this option.

The various reasons of optimization and greater stability are explained in the read me file.