Search code examples
google-cloud-platformcpu

google_osconfig's CPU usage of VM on Google Cloud Platform increases steadily


I have been used google cloud platform to offer the services to clients. A few days ago, I found the problem that the CPU usage of VM keeps increasing continuously. For uncovering the reason of this problem, I made the empty(or new) VMs to watch their status, and these new VMs also keeps increasing their CPU usages.

enter image description here

I used "top" command to know which process takes CPU resources, and the result makes me shocked. "google_osconfig" keeps consuming CPU resources, and it is eating more and more like pigs.

enter image description here

what is "google_osconfig", and is there anyone who know to solve this problem?

enter image description here

I restarted google-osconfig-agent to make it release its CPU usage. After using "service google-osconfig-agent restart", the CPU usage decreased.


Solution

  • google_osconfig It is part of the VM Manager, this definition is in the documentation

    VM Manager is a suite of tools that can be used to manage operating systems for large virtual machine (VM) fleets running Windows and Linux on Compute Engine.

    The following services are available as part of the VM Manager suite:

    • OS inventory management: osinventory
    • OS patch management: tasks
    • OS configuration management: guestpolicies

    The OS Config agent is installed by default on Red Hat Enterprise Linux (RHEL), Debian, CentOS, and Windows images that have a build date of v20200114 or later.

    You could check the status of this service with the following command:

    sudo systemctl status google-osconfig-agent
    

    If it was a problem with some subprocess that started the CPU consumptions the restart you made will fix it.

    But it might a problem with the service, maybe the version you are using has a problem, you could consider updating the OS Config agent.

    To update the agent on CentOS and RHEL operating systems, run the following command:

    sudo yum update google-osconfig-agent
    

    To update the agent on Debian and Ubuntu operating systems, run the following commands:

    sudo apt update
    sudo apt install google-osconfig-agent
    sudo service google-osconfig-agent restart