1

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.

7
  • Have you overcommited CPU? Commented Mar 4, 2020 at 8:42
  • 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?
    – Seth
    Commented Mar 4, 2020 at 9:11
  • @Seth Because VM's CPU almost reaches 100% - I can it with top command Commented Mar 4, 2020 at 10:42
  • @EugenRieck It just almost hits 100% Commented Mar 4, 2020 at 10:43
  • Having a 100% utilization and over commiting your CPU are related but not exclusive. What he means is whenever e.g. your physical computer only has 4 cores and your VMs use a total of 8 cores. With "almost" reaching 100% it's no wonder that your machine becomes unresponsive. Fix what's causing that high utilization and you will probably get rid of the problem. This might involve rewriting your code to be less demanding or getting better hardware if you can't fix it some other way.
    – Seth
    Commented Mar 4, 2020 at 11:04

0

You must log in to answer this question.

Browse other questions tagged .