Tag Archives: Interface test

[Solved] JMETER pressure measure with a lot of Ports Error: 504GATEWAY TIMEOUT

1. First check the test environment

2. Check the test script for problems, such as the failure of the previous request and the error caused by the subsequent request

3. Niginx work_Connection configuration

4. Due to system limits open files restrictions

One. When the number of threads under pressure test is too large, or the threads are not released in time, the open TCP/IP connection port of the system has reached the maximum limit, and JMeter will directly report an error
[error message]: java.net.bindexception: address ready in use.
[cause analysis]: Windows provides 1024-5000 ports for TCPIP connection, and it takes about four minutes to recycle, which leads to that when we frequently call a large number of requests in a short time, the port will be full.
[solution]:

1. Open the registry: CMD (Win + R) enter regedit to open the registry;
2. Set the system parameter: the maximum number of port connections.
① find the system parameter setting item: \hkey_local_machine\system\currentcontrolset\services\TCPIP\parameters
② right click parameters to add a new DWORD with the parameter name maxuserport;
③ double click maxmaxuserport, and the entered value is 65534 Select decimal
④ restart the computer! Restart the computer! Restart the computer
2. Socket closed
[cause analysis]: the number of threads has reached the bottleneck.
[solution]

1. When creating a thread in a loop, check keep alive to reuse the thread
2. Expand the thread pool size of the program under test. (when the program has a bottleneck)
III. insufficient memory
[exception]: a large number of. Hprof files are generated in the JMeter installation directory.
[cause analysis]: the generation of such. Hprof files is caused by memory leakage.
[solution]:

1. Upgrade the hardware configuration of JMeter pressure measuring machine to increase memory space
2. Modify the system parameters of JMeter
① open JMeter Bat file
② modify the memory usage size of JMeter pressure tester:
set heap = – xms3g – xmx3g – XX: maxmetaspacesize = 768m (1g by default, modified to 3G)
3. Detect the tested program and find out whether there is memory leakage in the tested software program.
IV. bandwidth bottleneck
[phenomenon]: a large number of request timeouts occur in JMeter execution results, but the server of the tested program does not have error protection log.
[analysis]: it may be that the bandwidth of the master computer has reached the bottleneck.
[solution]:

1. Upgrade the hardware configuration of the main control computer and expand the bandwidth value, such as from 100MB → 500MB
2. Divide multiple main controllers equally to avoid too many remote actuators of a single main controller. It is best to control within 10
distributed testing has some basic limitations. The following items are mentioned in the official documents:

1. RMI cannot communicate across subnets without an agent; Therefore, during distributed pressure measurement, all actuators of JMeter should be placed in the same network segment
2. Starting from version 2.9, JMeter sends all test results of stripping response data to the console, which can reduce the impact on network io. Ensure that network traffic is monitored to avoid traffic contention
3. When a single JMeter client runs on a host with a 2-3 GHz CPU, it can process 1000-2000 threads, depending on the type of test
(this also depends on the complexity of the business process. If a long connection is involved in the business process, the measured single JMeter client can only better support 800-1000 threads)
VI. it is recommended to
restart the piezoelectric machine regularly, and it is best to restart the computer before each pressure test.
regularly clean the log file generated by JMeter: jmeter.log & jmeter-server.log (under the installation directory).
during distributed deployment, it is better for one master computer to control only less than 10 executors to avoid the bottleneck of bandwidth and memory of the master computer.
during pressure measurement, it is necessary to monitor the resource usage of CPU, memory, network and IO of the lower pressure measurement machine.

[Solved] Jenkins+Ant Error: Error reading project file xxxxx

My colleague used Jenkins + ant + JMeter to build the interface automation shelf. Today, my colleague asked me to help look at a problem

The error reports are as follows:
error reading project file/var/lib/Jenkins/workspace/2021. M6/build. XML

at first, I thought the file could not be found. Later, I went to the server to check it. The file is in. (after thinking about it carefully, it should be not find if the file cannot be found. This error means that there is an error reading the file. In fact, there is an error reading and writing due to insufficient permissions)
later, I can successfully execute the ant command on the server
after step-by-step analysis and troubleshooting, it is found that it is a problem of permissions. After Jenkins is installed on the server, a user named Jenkins is automatically created. By default, the permissions of this user are also used
when I switch the Linux user to Jenkins and execute the ant command, the above error is reported. The root user will not report an error
therefore, the solution is to increase the permissions of Jenkins to root
1. Add the Jenkins user to the root group

gpasswd -a root jenkins

2[UNK]vim /etc/sysconfig/jenkins

JENKINS_USER="root"
JENKINS_GROUP="root"

3. Restart Jenkins

service jenkins restart

Final effect:

Yapi platform deployment error (MAC must report error) solution

1. Deploy Yapi locally

According to the official documents, after the global installation of Yapi CLI and mongodb, the terminal executes Yapi server, and the browser enters 127.0.0.1:9090 to open the deployment page

After filling in the basic information, click Start deployment, wait for a period of time, the problem appears

node server/install.js

Error:internal/modules/cjs/loader.js:584
   throw err;

Errpr:Cannot find module 'nodemailer'
  at Function.Module_resolveFileName(.........)
  at Function.Module_resolveFileName(.........)
  ........

   

The reason for the error is probably the lack of nodemailer module, so I tried to install the module globally. After the installation, I still reported the same error. In this way, I kept looking for the error. I deleted the project and started over again. After repeated tossing and tossing, I was about to re install the system. After one afternoon’s tossing and tossing, I finally found a solution

2. Solutions

Due to the problem of MAC permission, Yapi is initialized according to the official document writing method, and finally there is no write permission in NPM, resulting in the loss of packets

Modify the “Yapi server” as

sudo yapi server

Then the project is deployed again and the problem is solved