On Debian 7.0, the PHP daemon rotates in an infinite loop.
And so, in the top utility, CPU utilization is 97–98%.
I think that the script loads percents because there is a constant access to the file system, that is, the directory is constantly scanned for files. If there are files, the script reads one file at a time, deletes it, and executes something (basically, calls to the external API, there are no space calculations). Then the next file. Basically, the script is chasing idle, that is, there are no files.
How to optimize? But when working with a script, it works instantly, some 1-3 seconds.