httpd defunct 继续对 httpd defunct 的试验.doc
文本预览下载声明
httpd defunct 继续对 httpd defunct 的试验
导读:就爱阅读网友为您分享以下“继续对 httpd defunct 的试验”资讯,希望对您有所帮助,感谢您对92的支持!
继续对 httpd lt;defunctgt; 的试验
最近的 httpd lt;defunctgt; 又频繁增多,主要原因现在还在寻找中。今天通宵看了很多文摘,同时也有所心得。现在把整个过程记录一下,以备后用。
第一步,针对log 文件的作排除性工作。(关于 论请看。但是这个 bug 已经被修补。)
这一步也就是清除以前的log文件,使用新的 来使log文件进行循环记录。前几天已经对 cronolog 作了介绍,这里仅仅把在 httpd.conf 和 awstats.hostname.conf中修改的部分指摘一下。
建立新 log 目录
# mkdir /usr/local/apache2/log//
httpd.conf 中的 log 部分的修改 ErrorLog “|/usr/local/sbin/cronolog
/usr/local/apache2/logs//-error_log.%Y-%m”
CustomLog “|/usr/local/sbin/cronolog /usr/local/apache2/logs//_log.%Y-%m” combined env=!LIMITIP
awstats.weblog.conf中的修改
LogFile=“/usr/local/apache2/logs//-access_log.%YYYY-1-%MM-1”
备份好awstats的数据目录,在我的主机里面是 /var/lib/awstats/ 这样就排除了 2G log 的限制而导致 httpd 的问题。
第二步,由 PHP script 带来的一些修改。
查看了 apache 的 error log文件,发现有以下错误信息。
[client 16] PHP Warning: : supplied argument is not a valid MySQL-Link resource in /home/hzmjp/public_html/phpbb2.1.1_patched_from_2.1.0/db/mysql4.php on line 331
[client 1] PHP Warning: mysql_connect(): #HY000Host ‘’ is not allowed to connect to this MySQL server in
/home/hzmjp/public_html/phpbb2.1.1_patched_from_2.1.0/db/mysql4.php on line 48, referer:
PHP Warning: mysql_connect(): Too many connections ... lt;这个是我在用 httperf测试时出现的,暂且也算一个问题吧...gt; 这里首先对 进行修正。
我google了一下后,以下这篇文章给我很多hints:
其主要原因是 mysql_pconnect() 的 mysql_connect() 的互用问题。于是查询了错误所在行,即 phpbb 2.1 的 ./db/mysql4.php 中的第 48 行。将 $this-gt;db_connect_id = ($this-gt;persistency) ?
mysql_pconnect($this-gt;server, $this-gt;user, $this-gt;password) :
mysql_connect($this-gt;server, $this-gt;user, $this-gt;password);
改为了:
$this-gt;db_connect_id = ($this-gt;persistency) ? mysql_connect($this-gt;server, $this-gt;user, $this-gt;password) : mysql_connect($this-gt;server, $this-gt;user, $this-gt;password);
同时,根据 MySQL Manual 中关于 Too many connections 此的描述,修改了 f 等一些设置。
第三步,对 MySQL 的 f 和 php.ini 的一些修改。
首先添加了改一下 f 中的设置
max_connections = 300
同时我也查询了一下 MySQL 关于 performance 的问题。使用一下语句可以查询 MySQL 的现状: [roo
显示全部