
<?phpinclude("conn.php");//数据库链接,自己解决$sql="select*fromnews";$query=mysql_query($sql);$all_num=mysql_num_rows($query);//总条数$page_num=3;//每页条数$page_all_num=ceil($all_num/$page_num);//总页数$page=empty($_GET['page'])?1:$_GET['page'];//当前页数$page=(int)$page;//安全强制转换$limit_st=($page-1)*$page_num;//起始数//===========================================...

1.同事跑了一个php的抓取,这个会导致非常高的sleep值,大概到好几千的水平.进而mysql会down掉.写了个crontab#crontab-e[php]**/1***/sh/detect_php.sh**/1***/sh/detect_php.shdetech_php的内容[php]#!/bin/bashhost_dir=`cd/sh`proc_name="mysql"bug_time=`date-R`pid=0proc_num(){num=`ps-ef|grep$proc_name|grep-vgrep|wc-l`return$num}proc_id(){pid=`ps-ef|grep$proc_name|grep-vgrep|awk'{print$2}'`}proc_numnumber=$?if[$n...