Bad performance in the cURL call on the same server

210
August 07, 2017, at 4:18 PM

Why just few concurrency can cause block when cURL call on the same server

Example

phpdebug.com

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "http://phpdebug2.com",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

phpdebug2.com

<?php
echo "application2";

Apache ab test result

ab -n 10 -c 2 http://phpdebug.com/
Requests per second:    198.93 [#/sec] (mean) 
Time per request:       10.054 [ms] (mean) 
Time per request:       5.027 [ms] (mean, across all concurrent requests) 
Transfer rate:          33.80 [Kbytes/sec] received
ab -n 10 -c 3 http://phpdebug.com/
Requests per second:    60.42 [#/sec] (mean)
Time per request:       49.648 [ms] (mean)
Time per request:       16.550 [ms] (mean, across all concurrent requests)
Transfer rate:          10.27 [Kbytes/sec] received
ab -n 10 -c 4 http://phpdebug.com/
Requests per second:    17.68 [#/sec] (mean)
Time per request:       226.226 [ms] (mean)
Time per request:       56.557 [ms] (mean, across all concurrent requests)
Transfer rate:          3.00 [Kbytes/sec] received
ab -n 10 -c 5 http://phpdebug.com/
Benchmarking phpdebug.com (be patient)...apr_pollset_poll: The timeout specified has expired (70007)
  1. Why the Requests per second drop so fast?
  2. How to optimize this situation when cURL call on the same server?
Rent Charter Buses Company
READ ALSO
What is the best online quiz exam system using only php and mysql?Supported on 000webhost? [on hold]

What is the best online quiz exam system using only php and mysql?Supported on 000webhost? [on hold]

Help to find out pleaseand give me the whole project source code

204
how to get next month&#39;s date and it&#39;s not related to current month date in MySQL

how to get next month's date and it's not related to current month date in MySQL

I have three columns in my table, future 3 months like fistdate(next month), secondate(+2 next month) and thirdate(+3 next month) which are DATE typesI want to save my dates as follows 09/09/2017, 09/10/2017 and 09/11/2017 and current month is 07/08/2017...

237
SoftDelete php5 without framework [on hold]

SoftDelete php5 without framework [on hold]

hello how can I use SoftDelete in php5 without frameworkI need to delete a line from database but not physical

292
$1 $2 values are not getting used properly in .htaccess file [on hold]

$1 $2 values are not getting used properly in .htaccess file [on hold]

We have ahtaccess file with following contents RewriteEngine on RewriteBase /

188