您正在查看 "Linux" 分类下的文章
2009-10-16 11:06
| pid |
memcache服务器的进程ID |
| uptime |
服务器已经运行的秒数 |
| time |
服务器当前的unix时间戳 |
| version |
memcache版本 |
| pointer_size |
当前操作系统的指针大小(32位系统一般是32bit) |
| rusage_user |
进程的累计用户时间 |
| rusage_system |
进程的累计系统时间 |
| curr_items |
服务器当前存储的items数量 |
| total_items |
从服务器启动以后存储的items总数量 |
| bytes |
当前服务器存储items占用的字节数 |
| curr_connections |
当前打开着的连接数 |
| total_connections |
从服务器启动以后曾经打开过的连接数 |
| connection_structures |
服务器分配的连接构造数 |
| cmd_get |
get命令(获取)总请求次数 |
| cmd_set |
set命令(保存)总请求次数 |
| get_hits |
总命中次数 |
| get_misses |
总未命中次数 |
| evictions |
为获取空闲内存而删除的items数(分配给memcache的空间用满后需要删除旧的items来得到空间分配给新的items) |
| bytes_read |
总读取字节数(请求字节数) |
| bytes_written |
总发送字节数(结果字节数) |
| limit_maxbytes |
分配给memcache的内存大小(字节) |
| threads |
当前线程数 |
|
2009-03-23 11:07
整理电脑资料时,看到了n年前的资料,发出来凑个数,更新一下博客。
E**M中下载大文件碰到的问题大文件下载时apache 容易出现内存分配不够问题,因为下载时需要把文件内容用php读取出来,放在缓冲区中,如果输出和刷新内存缓冲的间隔控制不好的话,可能会引发内存分配不够,且下载速度相对比较慢的情形,目前的做法是在apache中限制每个进程最多的线程数和请求数以降低内存消耗,同时经过测试得到了一个经验值,就是每次读取50k内容到缓冲区,下载完之后刷新内存缓冲。例子程序如下:
while(!feof($fp))
{
echo fread($fp, 51200);
flush();
ob_flush();
}
fclose($fp);
ob_end_flush();
apache的主要配置参数如下:
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 128
MaxRequestsPerChild 1
</IfModule>
<IfModule worker.c>
StartServers 2
MaxClients 128
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 2
</IfModule>
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 2
</IfModule>
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 2
</IfModule>
<IfModule beos.c>
StartThreads 10
MaxClients 128
MaxRequestsPerThread 2
</IfModule>
<IfModule mpm_netware.c>
ThreadStackSize 65536
StartThreads 250
MinSpareThreads 25
MaxSpareThreads 250
MaxThreads 256
MaxRequestsPerChild 16
MaxMemFree 100
</IfModule>
<IfModule mpmt_os2.c>
StartServers 2
MinSpareThreads 5
MaxSpareThreads 10
MaxRequestsPerChild 16
</IfModule> |
2009-01-08 17:12
2008-12-29 13:44
rz/sz
secureCRT支持zmodem协议,确实是个好东西,输入rz即可自动弹出windows下的对话框选择要上传的文件。
输入sz files1 files2 ...即可把linux上的文件传到windows中来
具体在哪个目录可以在secureCRT中配置
|
2008-11-25 14:41
c r o n t a b文件每个条目中各个域的意义和格式:
第1列分钟1~5 9
第2列小时1~2 3(0表示子夜)
第3列日1~3 1
第4列月1~1 2
第5列星期0~6(0表示星期天)
第6列要运行的命令
下面是c r o n t a b的格式:
分<>时<>日<>月<>星期<>要运行的命令
其中<>表示空格
这里有c r o n t a b文件条目的一些例子:
30 21 * * * /apps/bin/cleanup.sh
上面的例子表示每晚的21:3 0运行/a p p s/b i n目录下的cleanup.sh。
45 4 1,10,22 * * /apps/bin/backup.sh
上面的例子表示每月1、1 0、2 2日的4 : 4 5运行/ a p p s / b i n目录下的b a c k u p . s h。
10 1 * * 6,0 /bin/find -name "core" -exec rm {} \;
上面的例子表示每周六、周日的1 : 1 0运行一个f i n d命令。
0,30 18-23 * * * /apps/bin/dbcheck.sh
上面的例子表示在每天1 8 : 0 0至2 3 : 0 0之间每隔3 0分钟运行/ a p p s / b i n目录下的d b c h e c k . s h。
0 23 * * 6 /apps/bin/qtrend.sh
上面的例子表示每星期六的11 : 0 0 p m运行/ a p p s / b i n目录下的q t r e n d . s h。
note that, after you finish your configure, saying, put the job on the file named "mycron", commit it using the command 'crontab mycron' to make it work. |
2008-06-27 14:06
最近发现服务器每次重启时间都会有很大 的误 差
baidu一下,发现ntpdate这个命令可以校正时间,很简单
就是用ntpdate通过ntp(network time protocol)协议,连接一个ntp服务器来校正时间
/etc/ntp.conf文件中有几个默认的时间服务器
把以下命令加入到cron中,每天执行一次
/usr/sbin/ntpdate 0.rhel.pool.ntp.org >> /tmp/time_up.log
同时加入到/etc/rc.local文件中,保证服务器每次重启后都校正
通过查看/tmp/time_up.log文件就可以看出什么时候校正过时间,且每次时间误差为多大。 |
|
|