Rootop 服务器运维与web架构

2012-09-07
发表者 Venus
暂无评论

mysqladmin -uroot -p status

[root@localhost ~]# mysqladmin -uroot -p status
Enter password:
Uptime: 59970  Threads: 1  Questions: 1381413  Slow queries: 0  Opens: 2362  Flush tables: 1  Open tables: 64  Queries per second avg: 23.35
[root@localhost ~]#

UptimeMySQL   服务器已经运行的秒数
Threads               活跃线程数量
Questions            从mysqld启动起来自客户端问题的数量
Slowqueries         已经超过 long_query_time 秒的查询数量
Opensmysqld      已经打开了多少表
Flushtables          flush , refresh 和 reload 命令数量
Opentables          现在被打开的表数量

2012-09-04
发表者 Venus
暂无评论

httpd 进程多 但正常连接少

      一台服务器中httpd进程达到一千多,在httpd.conf中配置的最大ServerLimit连接数为1000.这样看来服务器出现了新问题,用netstat查看已经连接的80端口数量并不算多,实际上并没有太多人访问。开始在网上查找资料,发现一片文章说sql语句的问题,导致httpd进程异常。然后根据提示,配置mysql:

vi /etc/my.cnf

add:

log-slow-queries=queries-slow.log

作用就是记录语句中查询超时之类的错误。服务器跑一会,检查日志:

/usr/libexec/mysqld, Version: 5.1.61-log (Source distribution). started with:
Tcp port: 3306  Unix socket: /var/lib/mysql/mysql.sock
Time                 Id Command    Argument
# Time: 120904 16:11:34
# User@Host: m7xxx[m7xxx] @ localhost []
# Query_time: 12.579957  Lock_time: 0.000117 Rows_sent: 605  Rows_examined: 4475386
use m7xxx;
SET timestamp=1346746294;
SELECT h.`id`, h.`name`, c.`QN` AS `city`, h.`address`, i.`tel`^M
                FROM `f7_hotel` h^M
                LEFT JOIN `f7_hotel_info` i ON i.`id` = h.`id`^M
                LEFT JOIN `f7_district` c ON c.`id` = IF(h.`city`=0, h.`province`, h.`city`)^M
                LEFT JOIN `f7_price` p ON p.`hotel` = h.`id` AND p.`close` = 0^M
                WHERE p.`id` IS NOT NULL AND p.`roomtype` != 0 AND h.`close` != 1^M
                GROUP BY p.`hotel`;

这段错误给php开发一看便知道问题。原来city没有加索引。

资料:http://www.doc88.com/p-063193394568.html

(本人开发白痴,哎)

2012-08-27
发表者 Venus
暂无评论

redhat企业版6中没有php-devel php-devel-5.3.3-3

     最近给海信做项目,服务器安装的redhat enterprise 6.1 x_64 ,在php中缺少某些组件,需要手动安装,就用到了phpize命令,我们知道phpize这个命令是在php-devel开发包中,但是在光盘镜像中就是找不到。最后是没辙了,应该是企业版6中去掉了。在pbone中找到了下载地址。

ftp://ftp.pbone.net/mirror/ftp.scientificlinux.org/linux/scientific/6.1/x86_64/os/Packages/php-devel-5.3.3-3.el6.x86_64.rpm

两种解决办法,第一就是用上面的地址,解决。其次就是用源码方式安装php。

2012-08-25
发表者 Venus
暂无评论

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

php版本为5.3.3 ,登陆phpmyadmin报错:

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

修改php.ini文件找到:

session.auto_start = 1   //默认为0,修改为1

重启httpd