Some of the advantages of the notes have been written in the previous log, do not explain
Tuning test throughput directly using JMeter
Code
package cn; import java.io.ioexception;import java.util.map;import java.util.weakhashmap; import javax.servlet.servletexception;import javax.servlet.annotation.webservlet;import javax.servlet.http.httpservlet;import Javax.servlet.http.httpservletrequest;import javax.servlet.http.httpservletresponse; import com . user; @WebServlet ("/testlogin") public class testlogin extends httpservlet { private static final long serialversionuid = 1l; private map<user,byte[]> userdata = new WeakHashMap<User,byte[]> ( protected void doget); Httpservletrequest request, httpservletresponse response) throws servletexception, IOException { User user = new user (); user.setid (1); user.setname (" Renlu "); user.setpwd (" 123 "); userdata.put (user,new byte[1024]); system.out.println ("HELLO&NBSP;BF "); request.getrequestdispatcher ( "Success.jsp"). Forward (Request, response); } protected void dopost (httpservletrequest request, httpservletresponse Response) throws ServletException, IOException { this.doget (Request, respOnse); }} Entity
package com; public class User { private int id; private string name; private string pwd; public int getid () { return id; } public void SetId (Int id) { this.id = id; } public string getname () { return name; } public void SetName (String name) { this.name = name; } public string getpwd () { Return pwd; } public void setpwd (STRING&NBSP;PWD) { this.pwd = pwd; } } test Environment Apache-tomcat-7.0.67,java version "1.8.0_60", apache-jmeter-2.13, test 3 times per throughput, take intermediate value
Number of test threads 10, thread Group 200
Default pre-tuning throughput
Throughput: 317
Tuning One:
Throughput 508
Tuning Two:
The Cenozoic parallel recycler, which is a collector of concern throughput, can minimize GC time in the old age also using the parallel recycle collector.
Throughput 681
Tuning Test Three:
Using-XX:+USECONCMARKSWEEPGC
Summarize:
The JVM tuning process is to determine the heap memory size (-XMX-XMS), reasonably allocate the Cenozoic and older generations (-xx:newratio,-xmn,-xx:survivorratio) to determine the size of the permanent zone (-xx:permsize,-xx: MaxPermSize), select the garbage collector, and make reasonable settings for the garbage collector. Of course, disable display GC, disable class metadata collection, disable class validation, and so on. Can be adjusted according to their actual situation.
Tomcat's JVM tuning combat