The objective of the following scripts are to send an Asynchronous PHP-Curl Request to a Server. I've been using the "fire and forget" technique in where a CURL request is sent to the server itself with a TIMEOUT_MS set to 100. The mainProcess.php will proceed as is with a delay of only 100 milliseconds and the sendMe.php will send a Curl to server C without delaying the execution of the mainProcess.php script.
I used another script (benchMarking.php) to print the execution time of firing the overall procedures.
benchMarking.php
$time_start = microtime(true);
PHP-Curl Post to Server B (mainProcess.php)
$time_end = microtime(true);
$time = $time_end - $time_start;
echo $time;
Initially, the $time is low. But as I continuously fire the benchMarking.php the $time increases. Resetting the Apache Server (Server B) is the only option in order to decrease the $time variable again. Hence, it must have something to do with the resources or connection handling of PHP. Any suggestions or workaround will be appreciated with regards to the problem.
Illustration of the Procedures.
References for the Fire and Forget Techniques:
http://www.tsartsaris.gr/how-to-make-asynchronous-post-with-php
http://www.paul-norman.co.uk/2009/06/asynchronous-curl-requests