ASP.NET MVC4应用程序在Debian x64 Linux中使用Apache,Mono 3.2.8和mod_mono运行
有时在每个月的服务器停止响应:
还有mod_mono控制面板和apache服务器状态模块istalled。
在浏览器中inputmysite.com
, mysite.com/server-status
/ mysite.com/mono
mysite.com/server-status
或mysite.com/mono
会一直等待。 顶部显示,CPU使用率几乎为零,并有大量的可用内存。
web.config中没有特殊的超时,所以每个线程应该在110秒后终止,即使挂起。 它看起来像Apache停止响应,也许达到最大数量的连接连接。 这是购物车应用程序,search引擎机器人每天都会对它进行大量的调用。
如何解决或find这些hangups的原因?
创造cron工作是否合理?
wget --tries=1 --timeout=5 www.mysite.com || /etc/init.d/apache2 restart
每10分钟后运行一次? 如果挂起发生,这将重新启动Apache?
使用crontab -e
和添加行
10 * * * * wget --tries=1 --timeout=5 www.mysite.com || /etc/init.d/apache2 restart
每小时只运行一次检查。 如何每10分钟检查一次?
apache2 -V返回:
Server version: Apache/2.2.22 (Debian) Server built: Feb 1 2014 21:26:17 Server's Module Magic Number: 20051115:30 Server loaded: APR 1.4.6, APR-Util 1.4.1 Compiled using: APR 1.4.6, APR-Util 1.4.1 Architecture: 64-bit Server MPM: Worker threaded: yes (fixed thread count) forked: yes (variable process count) Server compiled with.... -D APACHE_MPM_DIR="server/mpm/worker" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT="/etc/apache2" -D SUEXEC_BIN="/usr/lib/apache2/suexec" -D DEFAULT_PIDLOG="/var/run/apache2.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="mime.types" -D SERVER_CONFIG_FILE="apache2.conf"