Top Ten Processes Watcher

分类:Shelltop command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. But if you want get something more specific, you must play some tricks on it. For example, I want a clean view of top ten busiest processes every seconds without those summary info, how should I do with top?

Batch mode operation
top is a real-time application that keeps display processes info sorted by cpu usage, if you redirects the outputs to a file like command line below, you will having your results mixed with ugly symbols, which is not what you want. 继续阅读 »

Shell script to restart MySQL server if it is killed or not working

分类:Shell分类:MySQL# mysql root/admin username
MUSER=”root”
# mysql admin/root password
MPASS=”SET-ROOT-PASSWORD”
# mysql server hostname
MHOST=”localhost”
#Shell script to start MySQL server i.e. path to MySQL daemon start/stop script.
# Debain uses following script, need to setup this according to your UNIX/Linux/BSD OS.
MSTART=”/etc/init.d/mysql start” 继续阅读 »

2008-09-28PHP

没有评论
38

php通用检测函数

分类:PHP【变量定义规则】:’C_’=字符型,’I_’=整型,’N_’=数字型,’L_’=布尔型,’A_’=数组型
// ※CheckMoney($C_Money) 检查数据是否是
99999.99格式
// ※CheckEmailAddr($C_mailaddr) 判断是否为有效邮件地

// ※CheckWebAddr($C_weburl) 判断是否为有效网址
// ※CheckEmpty($C_char) 判断字符串是否为空
// ※CheckLengthBetween($C_char, $I_len1, $I_len2=100) 判断是否为指定长度内
字符串
// ※CheckUser($C_user) 判断是否为合法用户名
// ※CheckPassword($C_passwd) 判断是否为合法用户密

// ※CheckTelephone($C_telephone) 判断是否为合法电话号

// ※CheckValueBetween($N_var, $N_val1, $N_val2) 判断是否是某一范围内的
合法值 继续阅读 »

httpd与僵尸进程

分类:Apache在用top命令的时候,出现这个

3021  daemon    9   0     0    0     0 Z    10.4  0.0   0:01 httpd
3046  daemon    9   0     0    0     0 Z     9.7   0.0   0:01 httpd

这大概就是传说中的“僵尸进程”,僵尸进程表现为一般指连接数过多,造成的部分进程死掉的现象,维持几秒钟后会自动消失
,网上这样定义的,“僵尸进程是指的父进程已经退出,而该进程dead之后没有进程接受,就成为僵尸进程.(zombie)进程. 继续阅读 »


返回顶部