Mac 压测 卡主 问题

MAC 下通过 jmeter对spring boot 程序进行压测
  • 问题描述:无论指定线程数为多少,运行一段时间(5-20秒)左右,jmeter就会卡死,过一段时间(15-20秒)恢复,如此往复,更换JDK版本,增大MAC的文件描述符大小都没有效果.

  • 解决方法:

  1. 首先排除代码问题,同样的代码windows工作正常.怀疑是系统哪里被限制(参考Linux增大了文件打开数量,但还是不行.)

  2. 偶然间通过brew 安装siege,安装完毕有如下提示:

macOS has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.

You can check whether this is a problem with netstat:

    # sysctl net.inet.tcp.msl
    net.inet.tcp.msl: 15000

    # sudo sysctl -w net.inet.tcp.msl=1000
    net.inet.tcp.msl: 15000 -> 1000

Run siege.config to create the ~/.siegerc config file.
  1. 解决方案是按照上面的命令去执行,或者直接编辑 /etc/sysctl.conf文件加入相同的内容,我这里把15秒改为200毫秒,基本就没有问题了.

我心里一万个cmn,以后谁说mac适合开发,我就拿这个坑让他去试验.

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值