- 论坛徽章:
- 0
|
我在维护一站点,http://www.cqumzh.cn,一般情况下两小时内在线为3k~4k,有时候超过4K甚至5K。
结构为一台WEB服务器,一台数据库服务器,现在论坛数据大概有155G,论坛使用的啥子论坛我不是很清楚,
因为已经做了很多修改了。
现在感觉运行有点开始慢起来了(我在网内访问页面执行时间:0.088581 seconds.),想请大家给点优化意见。
谢谢。
由于是教育网内服务器,可能电信的朋友访问有点慢。
web服务器为 lenovo 万全620,硬件信息如下
==========================
CPU*4双核
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Xeon(TM) MP CPU 2.00GHz
stepping : 5
cpu MHz : 1990.289
cache size : 512 KB
physical id : 0
siblings : 2
runqueue : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 s
s ht tm
bogomips : 3971.48
内存为1*8
Mem: 8323502080 8298164224 25337856 0 137977856 7428136960
Swap: 4194869248 54984704 4139884544
MemTotal: 8128420 kB
MemFree: 24744 kB
MemShared: 0 kB
Buffers: 134744 kB
Cached: 7239432 kB
SwapCached: 14608 kB
Active: 6325688 kB
ActiveAnon: 529000 kB
ActiveCache: 5796688 kB
Inact_dirty: 1214568 kB
Inact_laundry: 189076 kB
Inact_clean: 175700 kB
Inact_target: 1581004 kB
HighTotal: 7338944 kB
HighFree: 1768 kB
LowTotal: 789476 kB
LowFree: 22976 kB
SwapTotal: 4096552 kB
SwapFree: 4042856 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB
硬盘是:
scsi1 : Adaptec AIC79XX PCI-X SCSI HBA DRIVER, Rev 1.3.10
<Adaptec AIC7902 Ultra320 SCSI adapter>
aic7902: Ultra320 Wide Channel B, SCSI Id=7, PCI-X 67-100Mhz, 512 SCBs
blk: queue f690d618, I/O limit 524287Mb (mask 0x7fffffffff)
(scsi0:A:0): 320.000MB/s transfers (160.000MHz DT|IU, 16bit)
(scsi0:A:1): 320.000MB/s transfers (160.000MHz DT|IU, 16bit)
(scsi0:A:2): 320.000MB/s transfers (160.000MHz DT|IU, 16bit)
(scsi0:A:3): 320.000MB/s transfers (160.000MHz DT|IU, 16bit)
(scsi0:A:4): 320.000MB/s transfers (160.000MHz DT|IU, 16bit)
WEB服务器运行在 RHEL4Ux(重编译内核)下,apache 2.0.x
apache用的worker模式
<IfModule worker.c>
StartServers 3
ServerLimit 72
ThreadLimit 100
MaxClients 7100
MinSpareThreads 50
MaxSpareThreads 250
ThreadsPerChild 100
MaxRequestsPerChild 10000
</IfModule>
Timeout 60
KeepAlive On
MaxKeepAliveRequests 3000
KeepAliveTimeout 10
DB服务器为DELL2950
CPU*2 双核,内存2G,SAS 硬盘10K转
系统使用FreeBSD 6.0-RELEASE (MYDB-SMP)
mysql 4.1.20
my.cnf
skip-locking
skip-innodb
skip-bdb
key_buffer = 512M
max_allowed_packet = 4M
table_cache =1024
record_buffer=32M
wait_timeout=120
interactive_time=120
max_heap_table_size=256M
tmp_table_size=128M
sort_buffer_size = 32M
read_buffer_size = M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 128M
thread_cache_size = 8
query_cache_size= 16M
max_connections=1000
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
mysql> show status;
+----------------------------+------------+
| Variable_name | Value |
+----------------------------+------------+
| Aborted_clients | 376 |
| Aborted_connects | 0 |
| Binlog_cache_disk_use | 0 |
| Binlog_cache_use | 0 |
| Bytes_received | 2413166749 |
| Bytes_sent | 2303058776 |
| Com_admin_commands | 0 |
| Com_alter_db | 0 |
| Com_alter_table | 0 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 1527480 |
| Com_change_master | 0 |
| Com_check | 0 |
| Com_checksum | 0 |
| Com_commit | 0 |
| Com_create_db | 0 |
| Com_create_function | 0 |
| Com_create_index | 0 |
| Com_create_table | 0 |
| Com_dealloc_sql | 0 |
| Com_delete | 188231 |
| Com_delete_multi | 0 |
| Com_do | 0 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 0 |
| Com_drop_user | 0 |
| Com_execute_sql | 0 |
| Com_flush | 0 |
| Com_grant | 0 |
| Com_ha_close | 0 |
| Com_ha_open | 0 |
| Com_ha_read | 0 |
| Com_help | 0 |
| Com_insert | 199643 |
| Com_insert_select | 0 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_data | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 0 |
| Com_optimize | 0 |
| Com_preload_keys | 0 |
| Com_prepare_sql | 0 |
| Com_purge | 0 |
| Com_purge_before_date | 0 |
| Com_rename_table | 0 |
| Com_repair | 0 |
| Com_replace | 0 |
| Com_replace_select | 0 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_revoke_all | 0 |
| Com_rollback | 0 |
| Com_savepoint | 0 |
| Com_select | 4894844 |
| Com_set_option | 365 |
| Com_show_binlog_events | 0 |
| Com_show_binlogs | 0 |
| Com_show_charsets | 0 |
| Com_show_collations | 0 |
| Com_show_column_types | 0 |
| Com_show_create_db | 0 |
| Com_show_create_table | 0 |
| Com_show_databases | 0 |
| Com_show_errors | 0 |
| Com_show_fields | 0 |
| Com_show_grants | 0 |
| Com_show_innodb_status | 0 |
| Com_show_keys | 0 |
| Com_show_logs | 0 |
| Com_show_master_status | 0 |
| Com_show_ndb_status | 0 |
| Com_show_new_master | 0 |
| Com_show_open_tables | 0 |
| Com_show_privileges | 0 |
| Com_show_processlist | 0 |
| Com_show_slave_hosts | 0 |
| Com_show_slave_status | 0 |
| Com_show_status | 1 |
| Com_show_storage_engines | 0 |
| Com_show_tables | 0 |
| Com_show_variables | 0 |
| Com_show_warnings | 0 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_stmt_close | 0 |
| Com_stmt_execute | 0 |
| Com_stmt_prepare | 0 |
| Com_stmt_reset | 0 |
| Com_stmt_send_long_data | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 0 |
| Com_update | 2442404 |
| Com_update_multi | 0 |
| Connections | 783398 |
| Created_tmp_disk_tables | 149047 |
| Created_tmp_files | 4 |
| Created_tmp_tables | 186050 |
| Delayed_errors | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Flush_commands | 1 |
| Handler_commit | 0 |
| Handler_delete | 185167 |
| Handler_discover | 0 |
| Handler_read_first | 30288 |
| Handler_read_key | 112723249 |
| Handler_read_next | 818317267 |
| Handler_read_prev | 569283627 |
| Handler_read_rnd | 24504187 |
| Handler_read_rnd_next | 1537446823 |
| Handler_rollback | 0 |
| Handler_update | 6803200 |
| Handler_write | 18840410 |
| Key_blocks_not_flushed | 0 |
| Key_blocks_unused | 246350 |
| Key_blocks_used | 101699 |
| Key_read_requests | 386554064 |
| Key_reads | 424012 |
| Key_write_requests | 18226069 |
| Key_writes | 92036 |
| Max_used_connections | 114 |
| Not_flushed_delayed_rows | 0 |
| Open_files | 609 |
| Open_streams | 0 |
| Open_tables | 610 |
| Opened_tables | 616 |
| Qcache_free_blocks | 2969 |
| Qcache_free_memory | 10342760 |
| Qcache_hits | 2885367 |
| Qcache_inserts | 4837281 |
| Qcache_lowmem_prunes | 46062 |
| Qcache_not_cached | 57624 |
| Qcache_queries_in_cache | 5775 |
| Qcache_total_blocks | 14556 |
| Questions | 12921643 |
| Rpl_status | NULL |
| Select_full_join | 152902 |
| Select_full_range_join | 0 |
| Select_range | 47017 |
| Select_range_check | 0 |
| Select_scan | 400620 |
| Slave_open_temp_tables | 0 |
| Slave_retried_transactions | 0 |
| Slave_running | OFF |
| Slow_launch_threads | 0 |
| Slow_queries | 34 |
| Sort_merge_passes | 2 |
| Sort_range | 83096 |
| Sort_rows | 70377148 |
| Sort_scan | 205200 |
| Table_locks_immediate | 8807246 |
| Table_locks_waited | 379556 |
| Threads_cached | 3 |
| Threads_connected | 10 |
| Threads_created | 23206 |
| Threads_running | 1 |
| Uptime | 128843 |
+----------------------------+------------+
163 rows in set (0.01 sec)
------------------------------------------------------------------------------
用TOP负荷也不重
web
23:14:58 up 4 days, 22:42, 2 users, load average: 2.24, 1.11, 0.82
77 processes: 76 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 10.3% 0.0% 1.4% 0.0% 1.2% 1.3% 85.4%
cpu00 7.8% 0.0% 0.5% 0.5% 3.8% 1.2% 86.0%
cpu01 10.6% 0.0% 1.7% 0.2% 0.2% 0.5% 86.5%
cpu02 8.1% 0.0% 1.2% 0.0% 0.0% 2.0% 88.5%
cpu03 9.6% 0.0% 0.7% 0.0% 5.0% 1.2% 83.2%
cpu04 9.4% 0.0% 1.2% 0.0% 0.0% 1.5% 87.7%
cpu05 11.1% 0.0% 2.2% 0.0% 0.5% 1.0% 84.9%
cpu06 15.2% 0.0% 2.2% 0.0% 0.2% 2.0% 80.1%
cpu07 10.6% 0.0% 1.5% 0.0% 0.0% 1.0% 86.7%
Mem: 8128420k av, 8110264k used, 18156k free, 0k shrd, 130724k buff
6337076k actv, 1212860k in_d, 129452k in_c
Swap: 4096552k av, 53812k used, 4042740k free 7157432k cached
db
last pid: 64768; load averages: 0.58, 0.58, 0.5238 up 17+01:58:35 23:26:34
48 processes: 2 running, 46 sleeping
CPU states: 2.8% user, 0.0% nice, 3.2% system, 0.2% interrupt, 93.8% idle
Mem: 303M Active, 2832M Inact, 214M Wired, 127M Cache, 112M Buf, 35M Free
Swap: 4048M Total, 20K Used, 4047M Free
netstat -an | grep -i ":80" | awk '{print $6}' | sort | uniq -c | sort -n
1 LISTEN
12 CLOSING
18 SYN_RECV
26 FIN_WAIT2
46 CLOSE_WAIT
65 LAST_ACK
215 FIN_WAIT1
359 TIME_WAIT
499 ESTABLISHED
==========================
下面是 server-info 信息
-----------------------------------------
Current Time: Friday, 04-May-2007 23:16:48 CST
Restart Time: Friday, 04-May-2007 05:50:18 CST
Parent Server Generation: 0
Server uptime: 17 hours 26 minutes 30 seconds
Total accesses: 4584518 - Total Traffic: 1351.2 GB
CPU Usage: u24.22 s3.39 cu0 cs0 - .044% CPU load
73 requests/sec - 22.0 MB/second - 309.0 kB/request
513 requests currently being processed, 187 idle workers
--------------------------------------------------------------------------
[ 本帖最后由 zhy_aid_cn 于 2007-5-4 23:33 编辑 ] |
|