Jarrett Croll
2012-08-28 04:06:51 UTC
I have a controller that is executing multiple cURL requests to third party
API's and updating a database with the results (it's using the Guzzle http
client library <http://guzzlephp.org/> if that helps). I would like to set
the time limit that the script can execute dynamically in the application
(not system wide in php.ini). The problem is thatset_time_limit() has the
following limitations <http://php.net/manual/en/function.set-time-limit.php>
:
The set_time_limit() function and the configuration directive
max_execution_time only affect the execution time of the script itself. Any
time spent on activity that happens outside the execution of the script
such as system calls using system(), stream operations, database queries,
etc. is not included when determining the maximum time that the script has
been running.
For a controller executing hundreds or thousands of cURL requests the
differences between the script execution time and the *actual* execution
time adds up fast. I can get the connection time of the cURL request by
using curl_getinfo($ch, CURLINFO_TOTAL_TIME) so I might just do something
with this but then I noticed the profiler toolbar section called "Timeline"
is producing accurate results of how long the controller took to execute.
Is there some way I can access the profiler's measure of execution time?
Would it also be available in the production environment?
Is there some best practice for limiting the execution time of a Symfony2
controller including all streams and database calls?
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2-/***@public.gmane.org
To unsubscribe from this group, send email to
symfony2+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
API's and updating a database with the results (it's using the Guzzle http
client library <http://guzzlephp.org/> if that helps). I would like to set
the time limit that the script can execute dynamically in the application
(not system wide in php.ini). The problem is thatset_time_limit() has the
following limitations <http://php.net/manual/en/function.set-time-limit.php>
:
The set_time_limit() function and the configuration directive
max_execution_time only affect the execution time of the script itself. Any
time spent on activity that happens outside the execution of the script
such as system calls using system(), stream operations, database queries,
etc. is not included when determining the maximum time that the script has
been running.
For a controller executing hundreds or thousands of cURL requests the
differences between the script execution time and the *actual* execution
time adds up fast. I can get the connection time of the cURL request by
using curl_getinfo($ch, CURLINFO_TOTAL_TIME) so I might just do something
with this but then I noticed the profiler toolbar section called "Timeline"
is producing accurate results of how long the controller took to execute.
Is there some way I can access the profiler's measure of execution time?
Would it also be available in the production environment?
Is there some best practice for limiting the execution time of a Symfony2
controller including all streams and database calls?
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2-/***@public.gmane.org
To unsubscribe from this group, send email to
symfony2+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en