On 11/12/2020 09:59, Máté Kocsis wrote:
I would also be very curious if
anyone is aware of the reasons why the CPU time metric was chosen back
then? In my opinion, wall-time is much more useful, but maybe I'm just
missing some technical limitations (?).


For most users, the max execution time is not really a precise metric, but a backstop to prevent against a process running forever - for instance, it will trap an accidental infinite loop (accidental infinite recursion, meanwhile, is often caught by the memory limit in my experience).

For that use case, it can actually be desirable to exclude things like database and network calls (i.e. to use CPU time rather than wall time) because they will vary for completely different reasons and on different scales.

For instance, if an SQL query takes 30 seconds, you might want to log that and work on optimising it, but your application is still functional. However, if a normal web page uses 30 seconds of CPU time in the main thread, something has probably gone seriously wrong, and you probably want to kill the process to stop it using all the server's resources.

I think your proposal to allow both limits to be set independently is sensible, and imagine that most users will want a much higher clock-time limit than the CPU-time limit.

Regards,

--
Rowan Tommins (né Collins)
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to