For tomcat benchmark testing

Reading time ~1 minute

Tomcat Configuration 查看一下可以配置的参数TomCat

设置JVM的参数Setting JVM Options for Tomcat

Edit the /usr/locat/apache-tomcat/bin/catalina.sh file and add the JVM options to the JAVA_OPTS environment variable.JVM Option Value Description
-Xmx 4g The maximum Java heap size.
-Xms 4g The initial Java heap size.
-Xmn 1g The size of young generation.
-XX:+UseParallelGC – To use parallel garbage collection for scavenges.
-XX:PermSize 50m The initial size of permanent generation.
注释:上面两个4g的值,我没试过,我用8GB内存windows的机器1.5GB能启动,超过了Tomcat服务就启动不了了。

配置Tomcat Connector Attributes
Edit the /usr/locat/apache-tomcat/conf/server.xml file and add the attributes listed in Table 3 to the Connector element.

下面是个例子供参考

Tomcat Configuration Attribute Value Description
The maximum number of request processing threads to be created by this connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, the default value for this attribute is 40. If an executor is associated with this connector, this attribute is ignored and the connector executes tasks using the executor rather than an internal thread pool.
maxThreads 3000
The maximum queue length for incoming connection requests when all
possible request processing threads are in use. Any requests received when
the queue is full are refused. The default value is 10.
acceptCount 2000
The number of request processing threads that are created when this connector
is first started. The connector also verifies that it has the specified number of
idle processing threads available. This attribute should be set to a value smaller
than that set for maxThreads. The default value is 4.
minSpareThreads 500
The maximum number of unused request processing threads that are allowed
to exist until the thread pool starts stopping the unnecessary threads. The
default value is 50.
maxSpareThreads 2000
Set to “true” if you want calls to request.getRemoteHost() to perform DNS
lookups in order to return the actual host name of the remote client. Set to
enableLookups false “false” to skip the DNS lookup and return the IP address in String form instead
(thereby improving performance). By default, DNS lookups are enabled.

上面的值比我实际使用的大,我的200并发测试通过了,硬件配置见前一帖。

互联网规模的超融合平台

什么是互联网规模?什么是web scale风格?看下Nutanix的亮点。 阅读全文

2017DevOps采用和趋势现状-信息图

Published on February 11, 2017