MONO 4.6.2服务器上的CPU高使用率 [英] MONO 4.6.2 High CPU Usage on Server

查看:269
本文介绍了MONO 4.6.2服务器上的CPU高使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经更新了我的

  • Ubuntu 服务器到 16.04.1 LTS
  • MONO v4.6.2
  • Ubuntu server to 16.04.1 LTS and
  • MONO to v4.6.2

...来自官方存储库.

...from official repository.

自更新以来,网站仍然可以正常运行,但是大约一两天后,一些MONO进程变得疯狂,占用了 CPU 100% .我有不同的网站;大部分是纯HTML,只包含少量代码.它随机发生,并且每次都在不同的网站上发生.这是完全随机的.

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.

然后我收到一封有关CPU使用率过高的电子邮件警报,通过SSH连接,键入"htop",然后终止该过程,然后恢复正常……一两天.

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.

这肯定看起来像是此MONO版本中的错误.有什么办法解决吗?还有其他人有这个问题吗?还是我应该切换到没有此损坏的其他版本?

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?

谢谢

2天后,每个 MONO进程占用了全部CPU.

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

查看Apache2日志文件,我可以找到与MONO相关的

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)

此外,服务apache2重新启动"不能解决问题.我必须手动终止进程,或重新启动.

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

推荐答案

尝试所有选项后,MONO似乎不适用于带有mod_mono的Apache2.我发现的唯一解决方案是将Apache2从prefork切换到工作模式,在该模式下,需要手动启动MONO服务器,而Apache2只是将请求转发给它-因此Apache2根本不直接接触MONO.有关如何执行此操作的文档很少,但是由于NGINX在该模式下工作,因此您可以找到有关如何为NGINX进行设置以及如何为Apache2转换应用程序配置文件的说明.

After trying all options, it seems MONO just doesn't work well with Apache2 with mod_mono. The only solution I found is to switch Apache2 from prefork to worker mode, where the MONO server needs to be started manually and Apache2 simply forwards the requests to it -- and thus Apache2 doesn't directly touch MONO at all. There is very little documentation on how to do this, but since NGINX works in that mode, you can find instructions on how to set it up for NGINX and translate the app config file for Apache2.

这些是开始的好地方

http://www.mono-project.com/docs/web/fastcgi/nginx/

http://epmjunkie.com/mono-fastcgi-startup-script/

这篇关于MONO 4.6.2服务器上的CPU高使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆