免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 31875 | 回复: 23
打印 上一主题 下一主题

[FreeBSD] 装BSD两个星期了,网站经常莫明其秒的挂掉,哪个高手帮帮我 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-04-01 17:21 |显示全部楼层 |倒序浏览
机器配置PD2.66  1G 160G
论坛DZ5.5
PHP Version 5.2.1
MYSQL 5
FreeBSD www.local.com 6.2-STABLE FreeBSD 6.2-STABLE #0: Fri Mar 23 03:44:52 CST 2007 root@www.local.com:/usr/obj/usr/src/sys/SuperKernel-SMP-ULE-64bit amd64

论坛刚开速度很快,可是15分钟在线人数超过400人后就容易出问题了,不是MYSQL报错就是APACHE挂掉,

专门找了做IDC方面的人帮我装的系统,做了很多优化,两个星期了,可是情况都没有怎么改善,看看这里有没有高手能看出是什么问题

论坛徽章:
0
2 [报告]
发表于 2007-04-01 18:29 |显示全部楼层
还需要哪些具体的配置情况?我一一列出来

论坛徽章:
0
3 [报告]
发表于 2007-04-01 20:34 |显示全部楼层
原帖由 iceblood 于 2007-4-1 19:03 发表
SuperKernel-SMP-ULE-64bit amd64
用ULE?别用这个。


是因为ULE的原因?那应该用哪个版本稳定高效呢?

dmesg的结果全是FAIL,难道哪里出问题了

[ 本帖最后由 kingstone32 于 2007-4-1 20:57 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2007-04-01 20:35 |显示全部楼层
原帖由 小稻 于 2007-4-1 18:52 发表
用PD做服务器,不荡死才怪


确实烫,搬服务器回来装系统的时候换过CPU风扇温度才降下来

论坛徽章:
0
5 [报告]
发表于 2007-04-01 20:41 |显示全部楼层
dmesg 的结果放上来:


swap_pager_getswapspace(3): failed
swap_pager_getswapspace(3): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(3): failed
swap_pager_getswapspace(4): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(4): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(3): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(: failed
swap_pager_getswapspace(3): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(3): failed
pid 21296 (httpd), uid 80, was killed: out of swap space
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed
swap_pager_getswapspace(16): failed

论坛徽章:
0
6 [报告]
发表于 2007-04-01 20:45 |显示全部楼层
原帖由 xuezongqing 于 2007-4-1 20:37 发表
是什么主板???估计硬件有问题。。你用的是什么机箱?什么板子?散热过关吗?


主板是技嘉的945G,怎么看得出是硬件问题呢,机箱是1U得,换过CPU风扇,温度在40-50度左右吧

论坛徽章:
0
7 [报告]
发表于 2007-04-02 04:09 |显示全部楼层
今天晚上我关闭了会员注册,晚上很晚回来看到论坛还没有挂掉,登录SSH速度还可以,先贴个TOP上来给大家看看

www# top
last pid: 37070;  load averages:  0.10,  0.08,  0.09    up 1+05:12:58  04:08:17
45 processes:  1 running, 44 sleeping
CPU states:  1.1% user,  0.0% nice,  1.3% system,  0.0% interrupt, 97.5% idle
Mem: 320M Active, 275M Inact, 205M Wired, 46M Cache, 111M Buf, 35M Free
Swap: 2002M Total, 240M Used, 1763M Free, 11% Inuse, 8K In

  PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
23320 mysql      13  20    0   813M   275M kserel 1 304:42  0.00% mysqld
29064 root        1   8    0   117M  4780K nanslp 0   0:17  0.00% httpd
  646 root        1  76    0  9468K  1088K select 0   0:03  0.00% sendmail
  493 root        1  76    0  3664K   452K select 0   0:02  0.00% syslogd
  640 root        1  76    0 19656K   444K select 0   0:01  0.00% sshd
37017 www         1   4    0   119M 13936K accept 1   0:01  0.00% httpd
37029 www         1  76    0   119M 13188K select 1   0:01  0.00% httpd
37035 www         1  76    0   118M 12572K select 1   0:01  0.00% httpd
  658 root        1   8    0  3664K   388K nanslp 0   0:01  0.00% cron
  652 smmsp       1  20    0  9336K   740K pause  0   0:01  0.00% sendmail
37052 www         1   4    0   119M 13280K accept 0   0:00  0.00% httpd
37050 www         1  76    0   119M 12956K select 1   0:00  0.00% httpd
37044 www         1   4    0   119M 13004K accept 0   0:00  0.00% httpd
37057 www         1  76    0   120M 13520K select 1   0:00  0.00% httpd
37056 www         1   4    0   119M 12036K accept 1   0:00  0.00% httpd
37066 www         1  76    0   119M 12148K select 1   0:00  0.00% httpd

论坛徽章:
0
8 [报告]
发表于 2007-04-02 10:51 |显示全部楼层
谢谢楼上的,apache已经转到进程模式了

www# apachectl -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c


www# apachectl -v
Server version: Apache/2.2.4 (FreeBSD)
Server built:   Mar 27 2007 02:27:31

my.cnf的配置:
# Example MySQL config file for very large systems.
#
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql5/var) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password       = your_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
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
max_connections=2048


# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
#log-bin=mysql-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# 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
#bdb_cache_size = 384M
#bdb_max_lock = 100000

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

[mysqldump]
quick
max_allowed_packet = 16M

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

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

论坛徽章:
0
9 [报告]
发表于 2007-04-02 10:56 |显示全部楼层
今天网站又挂掉了,TOP情况如下:

PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
23320 mysql      13  20    0   813M   269M kserel 1 383:36 12.70% mysqld
  646 root        1  76    0  9468K  1024K select 0   0:04  0.00% sendmail
  493 root        1  76    0  3664K   456K select 0   0:02  0.00% syslogd
  640 root        1  76    0 19656K   420K select 1   0:01  0.00% sshd
41342 root        1   8    0   117M 14544K nanslp 0   0:01  0.00% httpd
41458 www         1   4    0   119M 21084K accept 0   0:01  0.00% httpd
41459 www         1  76    0   119M 21012K select 1   0:01  0.00% httpd
  658 root        1   8    0  3664K   380K nanslp 0   0:01  0.00% cron
41430 www         1  76    0   119M 20752K select 0   0:01  0.00% httpd
  652 smmsp       1  20    0  9336K   768K pause  0   0:01  0.00% sendmail
41489 www         1  76    0   119M 20652K select 1   0:00  0.00% httpd
41485 www         1  76    0   119M 21012K select 1   0:00  0.00% httpd
41507 www         1   4    0   119M 20488K accept 0   0:00  0.00% httpd
41516 www         1   4    0   119M 20228K sbwait 1   0:00  0.00% httpd
41303 root        1  76    0 30604K  3392K select 1   0:00  0.00% sshd
41512 www         1   4    0   119M 20532K accept 1   0:00  0.00% httpd
41530 www         1  76    0   119M 20540K select 1   0:00  0.00% httpd

停掉APACHE后netstat和vmstat的结果:

www# netstat -an | grep 61.143.210.228.80 | grep "WA" | wc -l
    1620


www# vmstat
procs      memory      page                   disk   faults      cpu
r b w     avm    fre  flt  re  pi  po  fr  sr ad2   in   sy  cs us sy id
0 0 1 1078752  51216 1202  34  39  35 1437 2875   0  818 25986 8482  8 17 75

论坛徽章:
0
10 [报告]
发表于 2007-04-02 11:35 |显示全部楼层
没有调整最大连接数会报too many connects的错误,加到2048后就会经常出现下面的错误或者APACHE被阻死了,网页完全打不开

Discuz! info: Can not connect to MySQL server

Time: 2007-3-30 10:39pm
Script: /index.php

Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
Errno.: 2002

Similar error report has beed dispatched to administrator before.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP