Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

救助:高峰期出现如下情况

[复制链接]
longcool 发表于 2004-1-24 22:19:12 | 显示全部楼层 |阅读模式
10分钟700人/d2
服务器双p3-1.3
1GB RAM
100MB/5台共响



用top看到637processes 590 sleeping, 3 running 1 zombie
cpu 45%-80% user,当达到80%时
在d2下芳的数据恐怖
Processed in 2.262565 second(s), 6 queries, Gzip enabled
当45%-60%只有
Processed in 0.562565 second(s), 6 queries, Gzip enabled/最高
已经关闭sendmail,对mysql连接做了优化,pconnect = 1
对httpd也做了优化(但是不全面),
问题在哪里?????
谢谢!

[ Last edited by longcool on 2004-1-24 at 10:27 PM ]
Crossday 发表于 2004-1-25 09:17:37 | 显示全部楼层
进程数多所致 如果不想改my.cnf的timeout,可以将pconnect改为0
另外增加mysql的key_buffer 设置为256M左右
回复

使用道具 举报

 楼主| longcool 发表于 2004-1-26 20:44:29 | 显示全部楼层
谢谢老大,我把把apache 的keepalive關閉
了,情况好多了,但是发现
而且cpu站用率还是很高
在top命令下看到70%使用,21%为系统站用,但是无论怎样,剩下的
50%全被mysql占用了,
而内存是每条父进程站用39MB,共17个,约为700MB左右......

所以请教如何设置
“另外增加mysql的key_buffer 设置为256M左右”


[ Last edited by longcool on 2004-1-26 at 08:53 PM ]
回复

使用道具 举报

Crossday 发表于 2004-1-27 00:12:36 | 显示全部楼层
数据库占用在50%是可能发生的正常情况 因为数据库的运算量确实比较大
另外估计你内存不太够了 apache占用的比较多 其实keep-alive可以不用关掉
通过调节timeout和keep-alive timeout值即可

最后的问题 在/etc/my.cnf修改 如果没有 从软件包中将my-huge.cnf换名拷贝到/etc

广告时间 优化过仍然难以承受~换D3 呵呵
回复

使用道具 举报

BENDY 发表于 2004-1-27 02:46:47 | 显示全部楼层
主要问题应该是MYSQL。。
给你的MY。CNF参考一下。看能否帮你。QQ67052(初八后联系)

千万不要直接用HUGE。CNF。。。。。
回复

使用道具 举报

 楼主| longcool 发表于 2004-1-27 08:47:20 | 显示全部楼层
请问在apache+linux中,/etc/my.cnf的路径


我的主机里没这个文件

[ Last edited by longcool on 2004-1-27 at 09:10 AM ]
回复

使用道具 举报

cqfanli 发表于 2004-1-27 11:11:04 | 显示全部楼层
没有这个文件,说明用的是默认值,你可以COPY一个过去,有范例的
回复

使用道具 举报

 楼主| longcool 发表于 2004-1-27 23:48:04 | 显示全部楼层
下面是我现在正在使用的my.cnf文件,
除了把set-variable        = key_buffer=256M
由384改为256,其他都是my-huge原来的,
现在主机状况和没改前是1样的!
另外,我的主机是2cpu,在root只可以看到1个
主机商说,
Your machine should have two CPUs installed. It maybe that the other
CPU does not show up because LINUX SMP kernel is not enabled.

请帮忙改1下啊?我是直接copy过去的,
小弟千恩万谢了!



# The following options will be passed to all MySQL clients
[client]
password        = **************
port                = 3306
socket                = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port                = 3306
socket                = /tmp/mysql.sock
skip-locking
set-variable        = key_buffer=256M
set-variable        = max_allowed_packet=1M
set-variable        = table_cache=512
set-variable        = sort_buffer=2M
set-variable        = record_buffer=2M
set-variable        = thread_cache=8
# Try number of CPU's*2 for thread_concurrency
set-variable        = thread_concurrency=8
set-variable        = myisam_sort_buffer_size=64M
log-bin
server-id        = 1

# Point the following paths to different dedicated disks
#tmpdir                = /tmp/               
#log-update         = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#set-variable        = bdb_cache_size=384M
#set-variable        = bdb_max_lock=100000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#set-variable = innodb_buffer_pool_size=384M
#set-variable = innodb_additional_mem_pool_size=20M
# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=100M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
set-variable        = max_allowed_packet=16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
set-variable        = key_buffer=256M
set-variable        = sort_buffer=256M
set-variable        = read_buffer=2M
set-variable        = write_buffer=2M

[myisamchk]
set-variable        = key_buffer=256M
set-variable        = sort_buffer=256M
set-variable        = read_buffer=2M
set-variable        = write_buffer=2M

[mysqlhotcopy]
interactive-timeout

[ Last edited by longcool on 2004-1-28 at 12:44 AM ]
回复

使用道具 举报

BENDY 发表于 2004-1-28 14:14:24 | 显示全部楼层
[client]
#password        = **************   /不要加进去
port                = 3306
socket                = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port                = 3306
socket                = /tmp/mysql.sock
skip-locking
set-variable        = key_buffer=256M
set-variable        = max_allowed_packet=1M
set-variable        = table_cache=256             #太大
set-variable        = sort_buffer=2M
set-variable        = record_buffer=2M
set-variable        = thread_cache=64            #加大点
# Try number of CPU's*2 for thread_concurrency
set-variable        = thread_concurrency=8
set-variable        = myisam_sort_buffer_size=64M
#log-bin              #一定要删除
server-id        = 1

# Point the following paths to different dedicated disks
#tmpdir                = /tmp/               
#log-update         = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#set-variable        = bdb_cache_size=384M
#set-variable        = bdb_max_lock=100000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#set-variable = innodb_buffer_pool_size=384M
#set-variable = innodb_additional_mem_pool_size=20M
# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=100M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
set-variable        = max_allowed_packet=16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
set-variable        = key_buffer=256M
set-variable        = sort_buffer=256M
set-variable        = read_buffer=2M
set-variable        = write_buffer=2M

[myisamchk]
set-variable        = key_buffer=256M
set-variable        = sort_buffer=256M
set-variable        = read_buffer=2M
set-variable        = write_buffer=2M

[mysqlhotcopy]
interactive-timeout



其它的问题不大。
回复

使用道具 举报

BENDY 发表于 2004-1-28 14:21:02 | 显示全部楼层
另外。应该是你的LINUX内核编译时没有加进SMP(多CPU处理模块)。因此。你的双CPU没有被系统所支持。你应该马上升级你的内核。将SMP加进去。(这步骤最好是要求你服务商做。编译内核的危险性不少的。)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-2-24 00:51 , Processed in 0.039591 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表