压测过程中遇到的问题

1. 非GUI页面脚本报错:non http response code: java.net.noroutetohostexception/non http response message: cannot assign requested address (address not available)

执行机端口号占用
1、先检查下tcp port range 是否在合理范围内

[root@VM-85-168-centos ~]# cat /proc/sys/net/ipv4/ip_local_port_range
32768   60999

合理范围中,无需修改
2、调低端口释放后的等待时间, 默认为60s, 修改为15~30s

echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout

3、修改tcp/ip协议配置, 通过配置/proc/sys/net/ipv4/tcp_tw_resue, 默认为0, 修改为1, 释放TIME_WAIT端口给新连接使用

echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse

4、修改tcp/ip协议配置,快速回收socket资源, 默认为0, 修改为1

echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

5、执行命令使设置立即生效

sysctl -p

2. 执行机启动脚本报错内存不足

在这里插入图片描述

  1. 查看对应log文件,提示内存和swap不足
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8589934592 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2791), pid=4074, tid=0x00007f784019a700
#
# JRE version:  (8.0_402-b06) (build )
# Java VM: OpenJDK 64-Bit Server VM (25.402-b06 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
  1. 通过top命令和free命令查看,未使用swap,内存看起来也还有剩余
    在这里插入图片描述
    在这里插入图片描述
  2. 查看运行的进程:ps -ef,有一些jmeter进程占用内存
    在这里插入图片描述
  3. 原因,jmeter运行过程中使用ctrl+z暂停的运行进程,应使用ctrl+c结束进程

3、待补充

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值