apache最大压力测试

本文详细介绍了针对特定服务器配置进行性能优化的过程,并通过Apache JMeter进行了负载测试,包括服务器参数调整、并发线程数设置及测试结果分析。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

服务器:

地址:10.3.6.70,端口:80

CPU:Intel Xeon E312xx (SandyBridge)(四核,单核频率1999.999MHz)

内存:8G

硬盘:80G

系统:CentOS release 6.4 (Final),Linux 2.6.32-358.el6.x86_64


测试机:

CPU:Intel(R) Core(TM) i5-3470 CPU@ 3.20GHz

内存:8G

硬盘:500G

系统:Windows 7 Professional ServicePack 1,64位

测试工具:Apache JMeter Version 2.11r1554548


服务器参数调整:

sysctl.conf:

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30

net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_max_tw_buckets = 1000
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_keepalive_time = 1200
net.core.somaxconn = 32768

/etc/security/limits.conf:

* soft noproc 20480
* hard noproc 20480
* soft nofile 10240
* hard nofile 20480

/etc/pam.d/login:

session required /lib/security/pam_limits.so

~/.bash_profile:

ulimit -u 10000
ulimit -n 4000

/etc/httpd/conf/httpd.conf:

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 60

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive on

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100000

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 8

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
#ServerLimit      256
ServerLimit      10240
#MaxClients       256
MaxClients       10240
#MaxRequestsPerChild  4000
MaxRequestsPerChild  10240
</IfModule>

测试内容:

直接访问apache首页(根路径)(5196 bytes)。


并发线程数:10000

ramp-up period:180 sec


测试结果:

聚合报告:










服务器CPU和内存:



服务器httpd最大进程数:6240,总进程数:6400,80端口最大连接数:8300




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值