寻觅生命中的那一片浅草......

每日存档 五月 24th, 2009

Apache的prefork模式和worker模式

prefork模式
这个多路处理模块(MPM)实现了一个非线程型的、预派生的web服务器,它的工作方式类似于Apache 1.3。它适合于没有线程安全库,需要避免线程兼容性问题的系统。它是要求将每个请求相互独立的情况下最好的MPM,这样若一个请求出现问题就不会影响到其他请求。

这个MPM具有很强的自我调节能力,只需要很少的配置指令调整。最重要的是将MaxClients设置为一个足够大的数值以处理潜在的请求高峰,同时又不能太大,以致需要使用的内存超出物理内存的大小。

worker模式
此多路处理模块(MPM)使网络服务器支持混合的多线程多进程。由于使用线程来处理请求,所以可以处理海量请求,而系统资源的开销小于基于进程的MPM。但是,它也使用了多进程,每个进程又有多个线程,以获得基于进程的MPM的稳定性。

控制这个MPM的最重要的指令是,控制每个子进程允许建立的线程数的ThreadsPerChild指令,和控制允许建立的总线程数的MaxClients指令。
阅读全文»

查看Apache服务器Module加载状况

查看Apache服务器的Module加载状况
httpd -M

输出如下:

Loaded Modules:
core_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
auth_basic_module (shared)
authn_file_module (shared)
authz_host_module (shared)
authz_user_module (shared)
authz_groupfile_module (shared)
include_module (shared)
log_config_module (shared)
env_module (shared)
setenvif_module (shared)
mime_module (shared)
status_module (shared)
autoindex_module (shared)
vhost_alias_module (shared)
negotiation_module (shared)
dir_module (shared)
actions_module (shared)
userdir_module (shared)
alias_module (shared)
rewrite_module (shared)
cgi_module (shared)
php5_module (shared)
Syntax OK

查看已编译模块

httpd -l

输出如下:

Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c

mysqladmin的用法

mysqladmin 适合于linux和windows系统
linux下:mysqladmin -u[username] -p[password] status

windows下:先在安装目录找到mysqladmin.exe,然后在dos界面下change到这个目录,执行
mysqladmin -u[username] -p[password] extended-status

这里的extended-status 和status只是mysqladmin的两个参数而已!

阅读全文»

MySQL的监控方法

mysql的监控方法大致分为两类:

1.连接到mysql数据库内部,使用show status,show variables,flush status 来查看mysql的各种性能指标(nagios就是使用这种办法),输出到特定文件中,然后再取出来显示到页面。这里必须一个*.conf类似的文件用于保存数据库的用户名和密码等相关信息。

2. 直接使用mysqladmin查看其性能指标,具体体现到zabbix中就是在zabbix_agentd.conf文件中使用UserParameter做具体的每个指标,例如:

UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d”:”|cut -f1 -d”T”

这里的”mysql.uptime”就是我们在页面上需要输入的”key”,而逗号后面的则是这个key执行的命令。
阅读全文»

linux系统对密码复杂度的控制机制

我们在使用linux系统设置密码的时候,经常遇到这样的问题,系统提示:您的密码太简单,或者您的密码是字典的一部分。那么系统是如何实现对用户的密码的复杂度的检查的呢?
系统对密码的控制是有两部分(我知道的)组成:
1 cracklib
2 login.defs
阅读全文»

2009年五月
« 4月   6月 »
 123
45678910
11121314151617
18192021222324
25262728293031