How to expand the upper limit of the concurrent capacity of the maximum number of connections in resin

Method 1:
1. Find the bytecode class file to be modified: resin.jar->com/caucho/server/port/Port.class
2. Find the source code of the same version as the resin you use (eg: resin-pro -3.1.3)
3. Open the bytecode file Port.class and check the JDK version used. The 7th to 8th bytes are 0x0031, corresponding to Java 5 (JDK1.5) //3.1 Reference learning
link: https://www.cnblogs.com/yougewe/p/9710142.html
//3.2 Another way to view the version number: decompile the class file javap -verbose xxx.class "major version" corresponds to the decimal version number
4. Find the code "private int _connectionMax = 512;" in the com/caucho/server/port/Port.java file, and modify 512 to 10240.
5. Use the corresponding JDK version to compile com/caucho/server/port/Port.java to get the new Port.class
6. Update the new Port.class to com/caucho/server/port/Port in the resin.jar package .class file
//6.1 jar uf resin.jar com/caucho/server/port/Port.class
//6.2 Reference learning link: https://blog.csdn.net/huangbaokang/article/details/99971342
7. Change the value of <thread-max>1024</thread-max> in resin/conf/resin.conf to 10240.
8. Restart resin to take effect

Method 2 :
It is a painful thing to get an old JDK1.5 and find the resin source code. We might as well find the 512 in the bytecode file and change it to 10240 (there is only one 512 in this file, So our method should be feasible, if there are too many, it will be more difficult to determine which one)
1. Decompile the class file javap -verbose Port . class 2. Search "_connectionMax" to find the following paragraph         30: aload_0         31: sipush 512         34: putfield #13 // Field _connectionMax:I         37: aload_0 3. Through learning, we know that 3.1 aload_0 corresponds to bytecode 0x2a 3.2 sipush corresponds to bytecode 0x11 3.3 Decimal 512 converted to hexadecimal is 0x0200 3.4 The bytecode corresponding to putfield is 0xb5 3.5 #13 The corresponding bytecode is 0x000d 3.5 aload_0 The corresponding bytecode is 0x2a 4. Search " 2a 11 02 00 b5 00 0d 2a " in the Port.class bytecode file , will " 0200












"Change to " 2800 "
//4.1 2800 is the hexadecimal of the decimal number 10240
//4.2 There are two bytecode search results that need to be modified [The bytecode in the Code part will be repeated once, the specific reason is that I can’t Understood, please teach me what the byte code in the Code part of this paragraph means, thank you!]
5. Steps 6 to 8 in the same method

参考学习链接:
1.https://www.cnblogs.com/yougewe/p/9710142.html
2.https://zhuanlan.zhihu.com/p/64411980
3.https://blog.csdn.net/huangbaokang/article/details/99971342
4.http://www.blogjava.net/jelver/articles/183345.html
5.http://2hei.net/resin_http_pressure_test.html

Guess you like

Origin blog.csdn.net/zhongjuelong/article/details/111387193