I faced the problem that while running resource consuming command and opening a page I got both the server and virtual machine unresponsive.
I am using standard server pack for PHP 7.2: apache, php-fpm, php 7.2, mysql along with the virtual machine managed by Vagrant. Also I am developing on Symfony 4.
I am developing long time on such machines I did not have such a problem before. Now I have to execute the commands which are resource consuming. But I do not think that they use more resources that my previous ones.
The problem:
When I run a command (php command provided by Symfony) and open the web-page at the same time the page is loading a long time and I can not quite the command with Ctrl + C
. I can not do any other commands in cli (while being logged in with other ssh's
.
The only way I can handle it is using cpulimit
script - https://github.com/opsengine/cpulimit. When I set limit in 10% all things works fine. I could do it all the time. But it is rather workaround that actual solution and explanation of the problem.
Should mention that I use XDebug when running my commands. Yes, I tried without it. The only difference is that I got Killed
in console and the command is stopped. But generally it is the same: unresponsible server (page) and console.
Even when I send vagrant reload
I can see that it uses forced shutdown.
Edit
Looks like the page and command can not be ran at the same time on my server / VM. As I noted before, I got Killed
when running a command and opening the page while doing it. After that all things hanging on. Also vagrant can not stop the VM in a normal way which means that there is a process which uses all resources (I think so). But I can not see that process with top
.
Sometimes, when opening a page while running a command, console stops the command outputs Process 1617 terminated abnormally
.
Now I have to execute the commands which are resource consuming. But I do not think that they use more resources that my previous ones.
so why do you say those commands are resource consuming? Did watch the hardware utilization of the VM?top
command