我有一个有很多交通的在线游戏(每小时150万次查询)。这款游戏是iphone上的一种转基因游戏。但是,服务器运行缓慢:
CPU: 92% user, 3% kernel, 0% IO, 5% idle
Real Memory: 15.71 GB total, 985.17 MB used
服务器统计信息:
Memory: 16 GB
Disk: 256GB SAS
Trafic: 2 * 1 Gbit
CPU: 4 * 2Ghz
这些是我使用的设置:
ect/apache2/httpd.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 2
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 10
MaxSpareServers 20
ServerLimit 2000
MaxClients 1900
MaxRequestsPerChild 1000
在phpmyadmin,我有:
max connections = 2000
由于许多人同时玩游戏,我通过增加最大连接数来提高性能,但我不想将其设置为高,因此服务器崩溃。现在有2000个连接,CPU为92%(如上所述)。
我能做些什么来加快速度吗?
增加max_connections更安全吗?
为什么CPU如此之高且RAM内存如此之低?
提前致谢
编辑,来自/ proc / cpuinfo的信息
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 8356
stepping : 3
cpu MHz : 2320.957
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc rep_good tsc_reliable nonstop_tsc pni cx16 popcnt hypervisor lahf_lm extapic abm sse4a misalignsse 3dnowprefetch
bogomips : 4621.29
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 8356
stepping : 3
cpu MHz : 2320.957
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc rep_good tsc_reliable nonstop_tsc pni cx16 popcnt hypervisor lahf_lm extapic abm sse4a misalignsse 3dnowprefetch
bogomips : 4621.29
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 8356
stepping : 3
cpu MHz : 2320.957
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc rep_good tsc_reliable nonstop_tsc pni cx16 popcnt hypervisor lahf_lm extapic abm sse4a misalignsse 3dnowprefetch
bogomips : 4621.29
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 8356
stepping : 3
cpu MHz : 2320.957
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc rep_good tsc_reliable nonstop_tsc pni cx16 popcnt hypervisor lahf_lm extapic abm sse4a misalignsse 3dnowprefetch
bogomips : 4621.29
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: