How well does cURL work with a lot of users sending requests to a server?
For example, if a server accepts a URL from users, and like 20 people send a URL to the server around the same time, will the server be able to handle all the cURL requests? How is the performance? The server will be taking the URLs from users and doing this:
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_REFERER, $url);
curl_setopt($curl, CURLOPT_VERBOSE, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_AUTOREFERER, true );
As you can see, the server doesn't even echo what is returned from cURL, but it does run the exec..
I would have to take a stab and say it would be fine as usually only when your sending and receiving does it become a problem.
Okay let's say the server sends back (through echo) the
but that's all. Now do you see a problem? Or do you think it can handle a fair amount of users?
I personally think very small bits of data a server can handle fine but massive requests like remote files uploads and form i think will start to lag the server.
It's hard to say without having more information, eg how big is the site you are retrieving, is it a dedicated server or budget shared hosting, how much traffic will you have.
Under normal circumstances you shouldn't have any problems with that code, especially since you have the timeout.