i have a performance problem in my symfony 2.8 system. I have a function in a service where i am saving 2 entities and do some other stuff. This function is called from an controller in an POST Request and tooks 0.54 seconds for execution. This is ok but i also have a command, which is called hourly by a cronjob, which calls this function also and then it needs 55 seconds for execution.
How can it be?
In this function i am also dispatching an event that needs 0.04 seconds when called from controller and 18.2 seconds called from command.
My Server runs Debian and Plesk 17.8. I am calling the command with Plesk every Hour with php app/console XXXXXXXX --env=prod. I dont think its a symfony or doctrine problem. It looks likes the cron get only 1 % of the server resources for execution. Has someone an idea?
If i am calling the command manually from the cli the function is as fast as it would be called by the controller.
Thanks in advance.