Jun
7
Dmidecode 这款软件允许你在 Linux 系统下获取有关硬件方面的信息。Dmidecode 遵循 SMBIOS/DMI 标准,其输出的信息包括 BIOS、系统、主板、处理器、内存、缓存等等。偶发现这个工具很有用,就总结一下。
一、Dmidecode简介
DMI (Desktop Management Interface, DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。 SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force (DMTF)起草的开放性的技术标准,其中DMI设计适用于任何的平台和操作系统。
DMI充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了电脑厂商和用户对系统的了解。DMI的主要组成部分是Management Information Format (MIF)数据库。这个数据库包括了所有有关电脑系统和配件的信息。通过DMI,用户可以获取序列号、电脑厂商、串口信息以及其它系统配件信息。
dmidecode的输出格式一般如下:
Handle 0×0002 DMI type 2, 8 bytes Base Board Information Manufacturer:Intel Product Name: C440GX+ Version: 727281-0001 Serial Number: INCY92700942
其中的前三行都称为记录头(recoce Header), 其中包括了:
recode id(handle): DMI表中的记录标识符,这是唯一的,比如上例中的Handle 0×0002。
dmi type id: 记录的类型,譬如说:BIOS,Memory,上例是type 2,即”Base Board Information”
recode size: DMI表中对应记录的大小,上例为8 bytes.(不包括文本信息,所有实际输出的内容比这个size要更大。)记录头之后就是记录的值
decoded values: 记录值可以是多行的,比如上例显示了主板的制造商(manufacturer)、model、version以及serial Number。
二、Dmidecode的作用
dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。
三、安装Dmidecode
Dmidecode 在主流的 Linux 发行版中都可以找到,只需通过所用发行版的包管理器安装即可,如:
apt-get install dmidecode
或者使用官方包安装:
Dmidecode源码包下载地址:http://download.savannah.GNU.org/releases/dmidecode/
Win版本下载地址:http://gnuwin32.sourceforge.net/packages/dmidecode.htm
四、dmidecode命令用法详解
不带选项执行 dmidecode 通常会输出所有的硬件信息。Dmidecode 有个很有用的选项 -t,可以按指定类型输出相关信息,假如要获得处理器方面的信息,则可以执行
dmidecode -t processor
输出:
# dmidecode 2.10
SMBIOS 2.6 present.
Handle 0x0004, DMI type 4, 40 bytes
Processor Information
Socket Designation: CPU 1
Type: Central Processor
Family: Xeon
Manufacturer: Intel
ID: A5 06 01 00 FF FB EB BF
Signature: Type 0, Family 6, Model 26, Stepping 5
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
------
Usage: dmidecode [OPTIONS]
Options are:
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)
从设备文件读信息,输出内容与不加参数标准输出相同
-h, --help Display this help text and exit
显示帮助信息
-q, --quiet Less verbose output
显示更少的简化信息
-s, --string KEYWORD Only display the value of the given DMI string
只显示指定DMI字符串的信息
-t, --type TYPE Only display the entries of given type
只显示指定条目的信息
-u, --dump Do not decode the entries
显示未解码的原始条目内容
--dump-bin FILE Dump the DMI data to a binary file
--from-dump FILE Read the DMI data from a binary file
-V, --version Display the version and exit
显示版本信息
五、dmidecode参数string及type列表
(1)Valid string keywords are:
bios-vendor
bios-version
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
system-uuid
baseboard-manufacturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chassis-type
chassis-version
chassis-serial-number
chassis-asset-tag
processor-family
processor-manufacturer
processor-version
processor-frequency
(2)Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
Cache
connector
slot
(3)type全部编码列表
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device
六、命令用法示例
查看服务器型号:dmidecode | grep 'Product Name'
查看主板的序列号:dmidecode |grep 'Serial Number'
查看系统序列号:dmidecode -s system-serial-number
查看内存信息:dmidecode -t memory
查看OEM信息:dmidecode -t 11
关于 Dmidecode 的更多用法,你可以通过指定 -h 选项查询。
一、Dmidecode简介
DMI (Desktop Management Interface, DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。 SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force (DMTF)起草的开放性的技术标准,其中DMI设计适用于任何的平台和操作系统。
DMI充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了电脑厂商和用户对系统的了解。DMI的主要组成部分是Management Information Format (MIF)数据库。这个数据库包括了所有有关电脑系统和配件的信息。通过DMI,用户可以获取序列号、电脑厂商、串口信息以及其它系统配件信息。
dmidecode的输出格式一般如下:
Handle 0×0002 DMI type 2, 8 bytes Base Board Information Manufacturer:Intel Product Name: C440GX+ Version: 727281-0001 Serial Number: INCY92700942
其中的前三行都称为记录头(recoce Header), 其中包括了:
recode id(handle): DMI表中的记录标识符,这是唯一的,比如上例中的Handle 0×0002。
dmi type id: 记录的类型,譬如说:BIOS,Memory,上例是type 2,即”Base Board Information”
recode size: DMI表中对应记录的大小,上例为8 bytes.(不包括文本信息,所有实际输出的内容比这个size要更大。)记录头之后就是记录的值
decoded values: 记录值可以是多行的,比如上例显示了主板的制造商(manufacturer)、model、version以及serial Number。
二、Dmidecode的作用
dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。
三、安装Dmidecode
Dmidecode 在主流的 Linux 发行版中都可以找到,只需通过所用发行版的包管理器安装即可,如:
apt-get install dmidecode
或者使用官方包安装:
Dmidecode源码包下载地址:http://download.savannah.GNU.org/releases/dmidecode/
Win版本下载地址:http://gnuwin32.sourceforge.net/packages/dmidecode.htm
四、dmidecode命令用法详解
不带选项执行 dmidecode 通常会输出所有的硬件信息。Dmidecode 有个很有用的选项 -t,可以按指定类型输出相关信息,假如要获得处理器方面的信息,则可以执行
dmidecode -t processor
输出:
# dmidecode 2.10
SMBIOS 2.6 present.
Handle 0x0004, DMI type 4, 40 bytes
Processor Information
Socket Designation: CPU 1
Type: Central Processor
Family: Xeon
Manufacturer: Intel
ID: A5 06 01 00 FF FB EB BF
Signature: Type 0, Family 6, Model 26, Stepping 5
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
------
Usage: dmidecode [OPTIONS]
Options are:
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)
从设备文件读信息,输出内容与不加参数标准输出相同
-h, --help Display this help text and exit
显示帮助信息
-q, --quiet Less verbose output
显示更少的简化信息
-s, --string KEYWORD Only display the value of the given DMI string
只显示指定DMI字符串的信息
-t, --type TYPE Only display the entries of given type
只显示指定条目的信息
-u, --dump Do not decode the entries
显示未解码的原始条目内容
--dump-bin FILE Dump the DMI data to a binary file
--from-dump FILE Read the DMI data from a binary file
-V, --version Display the version and exit
显示版本信息
五、dmidecode参数string及type列表
(1)Valid string keywords are:
bios-vendor
bios-version
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
system-uuid
baseboard-manufacturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chassis-type
chassis-version
chassis-serial-number
chassis-asset-tag
processor-family
processor-manufacturer
processor-version
processor-frequency
(2)Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
Cache
connector
slot
(3)type全部编码列表
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device
六、命令用法示例
查看服务器型号:dmidecode | grep 'Product Name'
查看主板的序列号:dmidecode |grep 'Serial Number'
查看系统序列号:dmidecode -s system-serial-number
查看内存信息:dmidecode -t memory
查看OEM信息:dmidecode -t 11
关于 Dmidecode 的更多用法,你可以通过指定 -h 选项查询。
Jun
7
1 Apache附带的工具ab
ab的全称是ApacheBench,是Apache附带的一个小工具,专门用于HTTP Server的benchmark testing,可以同时模拟多个并发请求。
在这个例子的一开始,我执行了这样一个命令ab -n 10 -c 10http://www.google.com/。这个命令的意思是启动ab,向www.google.com发送10个请求(-n 10) ,并每次发送10个请求(-c 10) ——也就是说一次都发过去了。
apache ab做重复压力测试不错,但是每次只能测试一个链接
D:\apahce\bin>ab.exe -n 10 -c 10 http://www.google.com/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.google.com (be patient).....done
Server Software: gws
Server Hostname: www.google.com
Server Port: 80
Document Path: /
Document Length: 4941 bytes
Concurrency Level: 10
Time taken for tests: 5.218750 seconds//**整个测试持续的时间**
Complete requests: 10//**完成的请求数量**
Failed requests: 9//**失败的请求数量**
(Connect: 0, Length: 9, Exceptions: 0)
Write errors: 0
Total transferred: 52730 bytes**整个场景中的网络传输量**
HTML transferred: 49540 bytes**整个场景中的HTML内容传输量**
Requests per second: 1.92 [#/sec] (mean) **大家最关心的指标之一,相当于LR中的每秒事务数,后面括号中的mean表示这是一个平均值**
Time per request: 5218.750 [ms] (mean) *大家最关心的指标之二,相当于LR中的平均事务响应时间,后面括号中的mean表示这是一个平均值**
Time per request: 521.875 [ms] (mean, across all concurrent requests)
Transfer rate: 9.77 [Kbytes/sec] received*平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题**
Connection Times (ms)
min mean[+/-sd] median max
Connect: 187 488 257.6 437 921
Processing: 312 1673 1204.4 1547 3985
Waiting: 296 1668 1206.3 1546 3984
Total: 593 2162 1432.6 1890 4906
**下面的内容为整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其中50%的用户响应时间小于**毫秒,60%的用户响应时间小于**毫秒,最大的响应时间小于 **毫秒**
Percentage of the requests served within a certain time (ms)
50% 1890
66% 2406
75% 3093
80% 3984
90% 4906
95% 4906
98% 4906
99% 4906
100% 4906 (longest request)
实际测试
Server Software: Apache/2.2.3
Server Hostname: www.netnov.cn
Server Port: 80
Document Path: /
Document Length: 18958 bytes
Concurrency Level: 10
Time taken for tests: 8.949 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1912100 bytes
HTML transferred: 1895800 bytes
Requests per second: 11.17 [#/sec] (mean)
Time per request: 894.906 [ms] (mean)
Time per request: 89.491 [ms] (mean, across all concurrent requests)
Transfer rate: 208.66 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 78 87 8.9 94 109
Processing: 219 752 122.2 781 875
Waiting: 219 510 179.9 515 843
Total: 312 839 121.3 859 953
Percentage of the requests served within a certain time (ms)
50% 859
66% 859
75% 875
80% 890
90% 921
95% 937
98% 953
99% 953
100% 953 (longest request)
-----------------------------------------------------------------------------
格式: ./ab [options] [http://]hostname[:port]/path
参数:
-n requests Number of requests to perform
//在测试会话中所执行的请求个数。默认时,仅执行一个请求
-c concurrency Number of multiple requests to make
//一次产生的请求个数。默认是一次一个。
-t timelimit Seconds to max. wait for responses
//测试所进行的最大秒数。其内部隐含值是-n 50000。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。
-p postfile File containing data to POST
//包含了需要POST的数据的文件.
-T content-type Content-type header for POSTing
//POST数据所使用的Content-type头信息。
-v verbosity How much troubleshooting info to print
//设置显示信息的详细程度 - 4或更大值会显示头信息, 3或更大值可以显示响应代码(404, 200等), 2或更大值可以显示警告和其他信息。 -V 显示版本号并退出。
-w Print out results in HTML tables
//以HTML表的格式输出结果。默认时,它是白色背景的两列宽度的一张表。
-i Use HEAD instead of GET
// 执行HEAD请求,而不是GET。
-x attributes String to insert as table attributes
//
-y attributes String to insert as tr attributes
//
-z attributes String to insert as td or th attributes
//
-C attribute Add cookie, eg. 'Apache=1234. (repeatable)
//-C cookie-name=value 对请求附加一个Cookie:行。其典型形式是name=value的一个参数对。此参数可以重复。
-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
//-P proxy-auth-username:password 对一个中转代理提供BASIC认证信任。用户名和密码由一个:隔开,并以base64编码形式发送。无论服务器是否需要(即, 是否发送了401认证需求代码),此字符串都会被发送。
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-h Display usage information (this message)
2 webbench
wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install
#webbench -c 100 -t 10 http://192.168.200.100/info.php
参数说明:-c表示并发数,-t表示持续时间(秒)
root@ubuntu-desktop:/etc/nginx/sites-available# webbench -c 100 -t 10 http://192.168.200.100/info.php
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.200.100/info.php
100 clients, running 10 sec.
Speed=19032 pages/min, 18074373 bytes/sec.
Requests: 3172 susceed, 0 failed.
3 Siege
apache ab做重复压力测试不错,但是每次只能测试一个链接
如何测试一组链接(比如从日志中导出的1个小时的日志,做真实压力测试),后来找到了这个:
Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
下载/安装
Siege时一个开放源代码项目:http://www.joedog.org/siege/
下载:
wget ftp://sid.joedog.org/pub/siege/siege-latest.tar.gz
安装:
#./configure ; make
#make install
#siege -help (如果有help出现,则已经安装成功)
siege包含了一组压力测试工具:
SIEGE (1) Siege是一个HTTP压力测试和评测工具.
使用样例:
任务列表:www.chedong.com.url文件
http://www.chedong.com/tech/
http://www.chedong.com/tech/acdsee.html
http://www.chedong.com/tech/ant.html
http://www.chedong.com/tech/apache_install.html
http://www.chedong.com/tech/awstats.html
http://www.chedong.com/tech/cache.html
http://www.chedong.com/tech/click.html
http://www.chedong.com/tech/cms.html
http://www.chedong.com/tech/compress.html
http://www.chedong.com/tech/cvs_card.html
http://www.chedong.com/tech/default.html
http://www.chedong.com/tech/dev.html
http://www.chedong.com/tech/gnu.html
….
siege -c 20 -r 2 -f www.chedong.com.url
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f www.chedong.com.url 任务列表:URL列表
输出样例:
** Siege 2.59
** Preparing 20 concurrent users for battle. 这次“战斗”准备了20个并发用户
The server is now under siege.. done. 服务在“围攻”测试中:
Transactions: 40 hits 完成40次处理
Availability: 100.00 % 成功率
Elapsed time: 7.67 secs 总共用时
Data transferred: 877340 bytes 共数据传输:877340字节
Response time: 1.65 secs 相应用时1.65秒:显示网络连接的速度
Transaction rate: 5.22 trans/sec 平均每秒完成5.22次处理:表示服务器后台处理的速度
Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92字节
Concurrency: 8.59 最高并发数 8.59
Successful transactions: 40 成功处理次数
Failed transactions: 0 失败处理次数
辅助工具:
增量压力测试:
为了方便增量压力测试,siege还包含了一些辅助工具:
bombardment (1)
是一个辅助工具:用于按照增量用户压力测试:
使用样例:
bombardment urlfile.txt 5 3 4 1
初始化URL列表:urlfile.txt
初始化为:5个用户
每次增加:3个用户
运行:4次
每个客户端之间的延迟为:1秒
输出成CSV格式:
siege2csv.pl (1)
siege2csv.pl将bombardment的输出变成CSV格式:
Time Data Transferred Response Time Transaction Rate Throughput Concurrency Code 200 (note that this is horribly broken.)
242 60.22 603064 0.02 4.02 10014.35 0.08
605 59.98 1507660 0.01 10.09 25136.05 0.12
938 59.98 2337496 0.02 15.64 38971.26 0.26
1157 60 2883244 0.04 19.28 48054.07 0.78
4 http_load
下载地址:http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz
程序非常小,解压后也不到100K 居家旅行 携带方便 呵呵
http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载。但是它不同于大多数压力测试工具,它可以以一个单一的进程运行,一般不会把客户机搞死。可以可以测试HTTPS类的网站请求。
命令格式:http_load -p 并发访问进程数 -s 访问时间 需要访问的URL文件
例如:
引用
http_load -p 30 -s 60 urllist.txt
准 备URL文件:tst.list,文件格式是每行一个URL,URL最好超过50-100个测试效果比较好,另外,测试结果中主要的指标是 fetches/sec 这个选项,即服务器每秒能够响应的查询次数,用这个指标来衡量性能。似乎比 apache的ab准确率要高一些,也更有说服力一些。
官方的例子:
引用
% ./http_load -rate 10 -seconds 60 urllist.txt
49 fetches, 4 max parallel, 289884 bytes, in 10.0148 seconds
5916 mean bytes/connection
4.89274 fetches/sec, 28945.5 bytes/sec
msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
4.89274 fetches/sec 这个值得就是说服务器每秒能够响应的查询次数为4.8左右
这个值得是根据 49 fetches / 10.0148 seconds 秒计算出来的
5 Web Application Stress 【附下载】
http://www.microsoft.com/downloads/details.aspx?FamilyID=e2c0585a-062a-439e-a67d-75a89aa36495&displaylang=en
说明:
1. 在“settings”的功能设置中,一个是Stress level (threads)这里是指定程序在后台用多少线程进行请求,也就是相当于模拟多少个客户机的连接,更加形象的就是说设置多少轰炸的线程数。一般填写 500~1000,因为这个线程数是根据本机的承受力来设置的,如果你对自己的机器配置有足够信心的话,那么设置的越高,轰炸的效果越好。
2.在“Test Run Time”中来指定一次压力测试需要持续的时间,分为天、小时、分、秒几个单位级别,你根据实际情况来设置吧!
使用:
在工具中点右键,选择Add命令,增加了一个新的测试项目:New script,对它进行设置,在主选项中的server中填写要测试的服务器的IP地址[192.168.200.100]。在下方选择测试的Web连接方式,这里的方式Verb选择 get,path选择要测试的Web页面路径[/info.php],
在“Settings”的功能设置中将Stress level (threads)线程数设置为1000。完毕后,点工具中的灰色三角按钮即可进行测试(如图4)。测试完毕,等待朋友把任务管理器以及连接查看的截图发过来!
攻 击开始后,朋友从任务管理器中可以看到CPU使用率已经达到100%,损耗率达到最大。在CMD窗口中使用命令netstat -an,可以看到我的IP地址在朋友服务器上的80端口进行了非常多的连接。而且它的Web网站已经打不开了,提示过多用户连接,达到了跟 D.O.S攻击一样的目的。
数据分析:
选择“View”菜单下的“Reports”命令,或单击工具栏上的 按钮,打开报告窗口,在左侧列表中展开相应的报告。
检查Socket Errors部分是否有任何的socket有关的错误(值不为0)。
Socket Errors
--------------------------------------------------------------------------------
Connect: 406
Send: 0
Recv: 306
Timeouts: 0
这里列出每种socket错误的解释:Connect——客户端不能与服务器取得连接的次数。如果这个值偏高,检查在客户端与服务器之间产生的任何潜在的错误。从每个客户端Ping服务器或telnet服务器的端口80验证你得到正确的回应;Send——客户端不能正确发送数据到服务器的次数。如果这个值偏高,检查服务器是否正确地工作着。在客户端打开一个浏览器然后手工点击站点页面验证站点正确地工作着;Recv——客户端不能正确从服务器接收数据的次数。如果这个值偏高,执行和Send错误相同的操作,还要检查一下如果你减低负载系数,错误是否跟着减少;Timeouts——超时的线程的数目,而且随后就关闭了。如果这个值偏高,在客户端打开一个浏览器,然后手工点击站点页面验证是否即使只有一个用户你的程序也会很慢。再做一个不同负载系数的压力测试,看看程序的潜在特征。
Result Codes
Code Description Count
================================================================================
200 OK 11058
NA HTTP result code not given 306
如果“socket”错误很低或为0,在左侧的报告列表中找到“Result Codes”部分。检查一下是否所有结果代码都是200,200表示所有请求都被服务器成功地返回。如果找到大于或等于400的结果,单击报告列表中的 “Page Data”节点,展开所有项目,查看每个脚本项在右边窗口页面数据的报告,找出出现错误的项目。
ab的全称是ApacheBench,是Apache附带的一个小工具,专门用于HTTP Server的benchmark testing,可以同时模拟多个并发请求。
在这个例子的一开始,我执行了这样一个命令ab -n 10 -c 10http://www.google.com/。这个命令的意思是启动ab,向www.google.com发送10个请求(-n 10) ,并每次发送10个请求(-c 10) ——也就是说一次都发过去了。
apache ab做重复压力测试不错,但是每次只能测试一个链接
D:\apahce\bin>ab.exe -n 10 -c 10 http://www.google.com/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.google.com (be patient).....done
Server Software: gws
Server Hostname: www.google.com
Server Port: 80
Document Path: /
Document Length: 4941 bytes
Concurrency Level: 10
Time taken for tests: 5.218750 seconds//**整个测试持续的时间**
Complete requests: 10//**完成的请求数量**
Failed requests: 9//**失败的请求数量**
(Connect: 0, Length: 9, Exceptions: 0)
Write errors: 0
Total transferred: 52730 bytes**整个场景中的网络传输量**
HTML transferred: 49540 bytes**整个场景中的HTML内容传输量**
Requests per second: 1.92 [#/sec] (mean) **大家最关心的指标之一,相当于LR中的每秒事务数,后面括号中的mean表示这是一个平均值**
Time per request: 5218.750 [ms] (mean) *大家最关心的指标之二,相当于LR中的平均事务响应时间,后面括号中的mean表示这是一个平均值**
Time per request: 521.875 [ms] (mean, across all concurrent requests)
Transfer rate: 9.77 [Kbytes/sec] received*平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题**
Connection Times (ms)
min mean[+/-sd] median max
Connect: 187 488 257.6 437 921
Processing: 312 1673 1204.4 1547 3985
Waiting: 296 1668 1206.3 1546 3984
Total: 593 2162 1432.6 1890 4906
**下面的内容为整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其中50%的用户响应时间小于**毫秒,60%的用户响应时间小于**毫秒,最大的响应时间小于 **毫秒**
Percentage of the requests served within a certain time (ms)
50% 1890
66% 2406
75% 3093
80% 3984
90% 4906
95% 4906
98% 4906
99% 4906
100% 4906 (longest request)
实际测试
Server Software: Apache/2.2.3
Server Hostname: www.netnov.cn
Server Port: 80
Document Path: /
Document Length: 18958 bytes
Concurrency Level: 10
Time taken for tests: 8.949 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1912100 bytes
HTML transferred: 1895800 bytes
Requests per second: 11.17 [#/sec] (mean)
Time per request: 894.906 [ms] (mean)
Time per request: 89.491 [ms] (mean, across all concurrent requests)
Transfer rate: 208.66 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 78 87 8.9 94 109
Processing: 219 752 122.2 781 875
Waiting: 219 510 179.9 515 843
Total: 312 839 121.3 859 953
Percentage of the requests served within a certain time (ms)
50% 859
66% 859
75% 875
80% 890
90% 921
95% 937
98% 953
99% 953
100% 953 (longest request)
-----------------------------------------------------------------------------
格式: ./ab [options] [http://]hostname[:port]/path
参数:
-n requests Number of requests to perform
//在测试会话中所执行的请求个数。默认时,仅执行一个请求
-c concurrency Number of multiple requests to make
//一次产生的请求个数。默认是一次一个。
-t timelimit Seconds to max. wait for responses
//测试所进行的最大秒数。其内部隐含值是-n 50000。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。
-p postfile File containing data to POST
//包含了需要POST的数据的文件.
-T content-type Content-type header for POSTing
//POST数据所使用的Content-type头信息。
-v verbosity How much troubleshooting info to print
//设置显示信息的详细程度 - 4或更大值会显示头信息, 3或更大值可以显示响应代码(404, 200等), 2或更大值可以显示警告和其他信息。 -V 显示版本号并退出。
-w Print out results in HTML tables
//以HTML表的格式输出结果。默认时,它是白色背景的两列宽度的一张表。
-i Use HEAD instead of GET
// 执行HEAD请求,而不是GET。
-x attributes String to insert as table attributes
//
-y attributes String to insert as tr attributes
//
-z attributes String to insert as td or th attributes
//
-C attribute Add cookie, eg. 'Apache=1234. (repeatable)
//-C cookie-name=value 对请求附加一个Cookie:行。其典型形式是name=value的一个参数对。此参数可以重复。
-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
//-P proxy-auth-username:password 对一个中转代理提供BASIC认证信任。用户名和密码由一个:隔开,并以base64编码形式发送。无论服务器是否需要(即, 是否发送了401认证需求代码),此字符串都会被发送。
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-h Display usage information (this message)
2 webbench
wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install
#webbench -c 100 -t 10 http://192.168.200.100/info.php
参数说明:-c表示并发数,-t表示持续时间(秒)
root@ubuntu-desktop:/etc/nginx/sites-available# webbench -c 100 -t 10 http://192.168.200.100/info.php
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.200.100/info.php
100 clients, running 10 sec.
Speed=19032 pages/min, 18074373 bytes/sec.
Requests: 3172 susceed, 0 failed.
3 Siege
apache ab做重复压力测试不错,但是每次只能测试一个链接
如何测试一组链接(比如从日志中导出的1个小时的日志,做真实压力测试),后来找到了这个:
Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
下载/安装
Siege时一个开放源代码项目:http://www.joedog.org/siege/
下载:
wget ftp://sid.joedog.org/pub/siege/siege-latest.tar.gz
安装:
#./configure ; make
#make install
#siege -help (如果有help出现,则已经安装成功)
siege包含了一组压力测试工具:
SIEGE (1) Siege是一个HTTP压力测试和评测工具.
使用样例:
任务列表:www.chedong.com.url文件
http://www.chedong.com/tech/
http://www.chedong.com/tech/acdsee.html
http://www.chedong.com/tech/ant.html
http://www.chedong.com/tech/apache_install.html
http://www.chedong.com/tech/awstats.html
http://www.chedong.com/tech/cache.html
http://www.chedong.com/tech/click.html
http://www.chedong.com/tech/cms.html
http://www.chedong.com/tech/compress.html
http://www.chedong.com/tech/cvs_card.html
http://www.chedong.com/tech/default.html
http://www.chedong.com/tech/dev.html
http://www.chedong.com/tech/gnu.html
….
siege -c 20 -r 2 -f www.chedong.com.url
参数说明:
-c 20 并发20个用户
-r 2 重复循环2次
-f www.chedong.com.url 任务列表:URL列表
输出样例:
** Siege 2.59
** Preparing 20 concurrent users for battle. 这次“战斗”准备了20个并发用户
The server is now under siege.. done. 服务在“围攻”测试中:
Transactions: 40 hits 完成40次处理
Availability: 100.00 % 成功率
Elapsed time: 7.67 secs 总共用时
Data transferred: 877340 bytes 共数据传输:877340字节
Response time: 1.65 secs 相应用时1.65秒:显示网络连接的速度
Transaction rate: 5.22 trans/sec 平均每秒完成5.22次处理:表示服务器后台处理的速度
Throughput: 114385.92 bytes/sec 平均每秒传送数据:114385.92字节
Concurrency: 8.59 最高并发数 8.59
Successful transactions: 40 成功处理次数
Failed transactions: 0 失败处理次数
辅助工具:
增量压力测试:
为了方便增量压力测试,siege还包含了一些辅助工具:
bombardment (1)
是一个辅助工具:用于按照增量用户压力测试:
使用样例:
bombardment urlfile.txt 5 3 4 1
初始化URL列表:urlfile.txt
初始化为:5个用户
每次增加:3个用户
运行:4次
每个客户端之间的延迟为:1秒
输出成CSV格式:
siege2csv.pl (1)
siege2csv.pl将bombardment的输出变成CSV格式:
Time Data Transferred Response Time Transaction Rate Throughput Concurrency Code 200 (note that this is horribly broken.)
242 60.22 603064 0.02 4.02 10014.35 0.08
605 59.98 1507660 0.01 10.09 25136.05 0.12
938 59.98 2337496 0.02 15.64 38971.26 0.26
1157 60 2883244 0.04 19.28 48054.07 0.78
4 http_load
下载地址:http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz
程序非常小,解压后也不到100K 居家旅行 携带方便 呵呵
http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载。但是它不同于大多数压力测试工具,它可以以一个单一的进程运行,一般不会把客户机搞死。可以可以测试HTTPS类的网站请求。
命令格式:http_load -p 并发访问进程数 -s 访问时间 需要访问的URL文件
例如:
引用
http_load -p 30 -s 60 urllist.txt
准 备URL文件:tst.list,文件格式是每行一个URL,URL最好超过50-100个测试效果比较好,另外,测试结果中主要的指标是 fetches/sec 这个选项,即服务器每秒能够响应的查询次数,用这个指标来衡量性能。似乎比 apache的ab准确率要高一些,也更有说服力一些。
官方的例子:
引用
% ./http_load -rate 10 -seconds 60 urllist.txt
49 fetches, 4 max parallel, 289884 bytes, in 10.0148 seconds
5916 mean bytes/connection
4.89274 fetches/sec, 28945.5 bytes/sec
msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
4.89274 fetches/sec 这个值得就是说服务器每秒能够响应的查询次数为4.8左右
这个值得是根据 49 fetches / 10.0148 seconds 秒计算出来的
5 Web Application Stress 【附下载】
http://www.microsoft.com/downloads/details.aspx?FamilyID=e2c0585a-062a-439e-a67d-75a89aa36495&displaylang=en
说明:
1. 在“settings”的功能设置中,一个是Stress level (threads)这里是指定程序在后台用多少线程进行请求,也就是相当于模拟多少个客户机的连接,更加形象的就是说设置多少轰炸的线程数。一般填写 500~1000,因为这个线程数是根据本机的承受力来设置的,如果你对自己的机器配置有足够信心的话,那么设置的越高,轰炸的效果越好。
2.在“Test Run Time”中来指定一次压力测试需要持续的时间,分为天、小时、分、秒几个单位级别,你根据实际情况来设置吧!
使用:
在工具中点右键,选择Add命令,增加了一个新的测试项目:New script,对它进行设置,在主选项中的server中填写要测试的服务器的IP地址[192.168.200.100]。在下方选择测试的Web连接方式,这里的方式Verb选择 get,path选择要测试的Web页面路径[/info.php],
在“Settings”的功能设置中将Stress level (threads)线程数设置为1000。完毕后,点工具中的灰色三角按钮即可进行测试(如图4)。测试完毕,等待朋友把任务管理器以及连接查看的截图发过来!
攻 击开始后,朋友从任务管理器中可以看到CPU使用率已经达到100%,损耗率达到最大。在CMD窗口中使用命令netstat -an,可以看到我的IP地址在朋友服务器上的80端口进行了非常多的连接。而且它的Web网站已经打不开了,提示过多用户连接,达到了跟 D.O.S攻击一样的目的。
数据分析:
选择“View”菜单下的“Reports”命令,或单击工具栏上的 按钮,打开报告窗口,在左侧列表中展开相应的报告。
检查Socket Errors部分是否有任何的socket有关的错误(值不为0)。
Socket Errors
--------------------------------------------------------------------------------
Connect: 406
Send: 0
Recv: 306
Timeouts: 0
这里列出每种socket错误的解释:Connect——客户端不能与服务器取得连接的次数。如果这个值偏高,检查在客户端与服务器之间产生的任何潜在的错误。从每个客户端Ping服务器或telnet服务器的端口80验证你得到正确的回应;Send——客户端不能正确发送数据到服务器的次数。如果这个值偏高,检查服务器是否正确地工作着。在客户端打开一个浏览器然后手工点击站点页面验证站点正确地工作着;Recv——客户端不能正确从服务器接收数据的次数。如果这个值偏高,执行和Send错误相同的操作,还要检查一下如果你减低负载系数,错误是否跟着减少;Timeouts——超时的线程的数目,而且随后就关闭了。如果这个值偏高,在客户端打开一个浏览器,然后手工点击站点页面验证是否即使只有一个用户你的程序也会很慢。再做一个不同负载系数的压力测试,看看程序的潜在特征。
Result Codes
Code Description Count
================================================================================
200 OK 11058
NA HTTP result code not given 306
如果“socket”错误很低或为0,在左侧的报告列表中找到“Result Codes”部分。检查一下是否所有结果代码都是200,200表示所有请求都被服务器成功地返回。如果找到大于或等于400的结果,单击报告列表中的 “Page Data”节点,展开所有项目,查看每个脚本项在右边窗口页面数据的报告,找出出现错误的项目。
Jun
7
今天查看系统日志发现大量的nf_conntrack: table full, dropping packet. 错误
cat /var/log/messages | more
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
解决办法:
vi /etc/sysctl.conf
加入:
net.nf_conntrack_max = 655350
net.netfilter.nf_conntrack_tcp_timeout_established = 1200
CENTOS 6.1或以上版本使用:
net.netfilter.nf_conntrack_max = 655350
net.netfilter.nf_conntrack_tcp_timeout_established = 1200
保存后执行 sysctl -p 使之生效,然后观察该错误是不是没有了。
cat /var/log/messages | more
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:05 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:10 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:15 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:23 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
Jun 7 09:52:30 localhost kernel: nf_conntrack: table full, dropping packet.
解决办法:
vi /etc/sysctl.conf
加入:
net.nf_conntrack_max = 655350
net.netfilter.nf_conntrack_tcp_timeout_established = 1200
CENTOS 6.1或以上版本使用:
net.netfilter.nf_conntrack_max = 655350
net.netfilter.nf_conntrack_tcp_timeout_established = 1200
保存后执行 sysctl -p 使之生效,然后观察该错误是不是没有了。