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

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

问题描述

我已经更新了我的:

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

...来自官方存储库.

...from official repository.

自更新以来,网站仍然运行良好,但大约一两天后,一些 MONO 进程会发疯并占用 100% CPU.我有不同的网站;大部分是纯 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)

另外,service apache2 restart"也不能解决问题.我必须手动终止进程,或者重新启动.

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天全站免登陆