Mono use 100% CPU



  • I've installed CloneDeploy on a Ubuntu 16.04 LTS server.
    Sometimes, after a while, mono as 3 instances loaded and use 100% CPU.

    Here's a ps aux command output showing the three mono instances running.

    root@srv-deploy01-t:~# ps aux |grep mono
    www-data 20778 20.3 15.9 796908 161880 ? Ssl Sep27 353:54 /usr/bin/mono --debug /usr/lib/mono/4.5/mod-mono-server4.exe --filename /tmp/mod_mono_server_clonedeploy --applications /clonedeploy:/var/www/html/clonedeploy --nonstop
    www-data 31849 0.0 3.3 284416 33580 ? Ssl 06:25 0:00 /usr/bin/mono /usr/lib/mono/4.5/mod-mono-server4.exe --filename /tmp/.mod_mono_server4 --nonstop --appconfigdir /etc/mono-server4
    www-data 31851 0.0 4.7 294964 47940 ? Ssl 06:25 0:00 /usr/bin/mono --debug /usr/lib/mono/4.5/mod-mono-server4.exe --filename /tmp/mod_mono_server_clonedeploy --applications /clonedeploy:/var/www/html/clonedeploy --nonstop

    And the top command
    top - 11:26:35 up 1 day, 17:46, 1 user, load average: 1.45, 1.55, 1.54
    Tasks: 156 total, 1 running, 155 sleeping, 0 stopped, 0 zombie
    %Cpu(s): 33.2 us, 66.8 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
    KiB Mem : 1016280 total, 96792 free, 331064 used, 588424 buff/cache
    KiB Swap: 1048572 total, 868988 free, 179584 used. 503756 avail Mem

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    20778 www-data 20 0 796908 161880 14692 S 99.7 15.9 353:33.87 mono
    3042 root 20 0 111124 3500 2788 S 0.3 0.3 1:05.56 vmtoolsd

    Any idea?
    Thanks.



  • This is an issue with apache semaphors and Mono, I haven't found the real culprit but I handle it by deleting all apache semaphors with an hourly cron job.
    [code]#!/bin/bash
    for i in $(ipcs | grep apache | awk '{print $2}'); do
    ipcrm -s $i;
    done;[/code]



  • Since your on Ubuntu grep apache should be www-data. Hopefully this is the same issue you are having. I haven't had this problem on Ubuntu, only CentOS. If you want you can wait until your cpu is 100% and issue ipcs to check the number of www-data semaphors