Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MONO 4.6.2 High CPU Usage on Server

I have updated my:

  • Ubuntu server to 16.04.1 LTS and
  • MONO to v4.6.2

...from official repository.

Since the update, the websites are still running fine, but after about a day or two, some of the MONO processes go crazy and take 100% of the CPU. I have different websites; mostly plain HTML with just a little bit of code. It happens randomly, and on different websites each time. It's totally random.

I then receive an email alert of high CPU usage, connect via SSH, type "htop", and kill the process and it's back to normal ... for a day or two.

This definitely looks like a bug in this version of MONO. Any way to fix it? Anyone else had this problem? Or perhaps I should switch to a different version that doesn't have this corruption?

Thanks

Edit: After 2 days, EVERY MONO process is taking up the full CPU.

Looking into the Apache2 log file, I could find this related to MONO

WARNING: WebConfigurationManager's LRUcache evictions count reached its max size
Cache Size: 100 (overridable via MONO_ASPNET_WEBCONFIG_CACHESIZE)

Also, "service apache2 restart" does not solve the problem. I must manually kill the processes, or reboot.

like image 795
Etienne Charland Avatar asked Oct 29 '22 12:10

Etienne Charland


1 Answers

I have played around with various MONO versions, and typing "service apache2 reload" to reproduce the high CPU usage problem.

In MONO 4.8, it seems to happen to happen a bit less often but the problem is still there.

In MONO 4.2.3.4, the problem is also there.

In MONO 4.2.1 that comes by default on Ubuntu, this problem doesn't happen.

As for .NET Core, some have tried it and highly recommended me to avoid it until it becomes more stable.

So for now, the only solution is to stick to MONO 4.2.1

This also confirms that this is related to MONO and not to my code or the server configuration.

like image 57
Etienne Charland Avatar answered Nov 01 '22 01:11

Etienne Charland