【问题标题】:ERROR : Load test HLS using JMeter with plugin HLS Sampler错误:使用带有插件 HLS 采样器的 JMeter 加载测试 HLS
【发布时间】:2018-09-19 02:17:27
【问题描述】:

我尝试使用 JMeter 和 HLS Sampler 来测试我的 HLS 服务器。但是在我的 cmd 上有一个通知错误。我该怎么办?

java.io.FileNotFoundException: http://192.168.2.215/vod/BF1.mp4/chunk.m3u8
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at com.blazemeter.jmeter.hls.logic.Parser.getBaseUrl(Parser.java:49)
        at com.blazemeter.jmeter.hls.logic.HlsSampler.getPlayList(HlsSampler.java:104)
        at com.blazemeter.jmeter.hls.logic.HlsSampler.sample(HlsSampler.java:156)
        at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498)
        at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: http://192.168.2.215/vod/BF1.mp4/chunk.m3u8
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at java.net.HttpURLConnection.getResponseCode(Unknown Source)
        at com.blazemeter.jmeter.hls.logic.Parser.getBaseUrl(Parser.java:46)
        ... 6 more

【问题讨论】:

    标签: jmeter http-live-streaming jmeter-plugins


    【解决方案1】:

    这是plugin 中的一个错误,它不能处理 URL 的所有可能性,我猜是重定向或相对 URL。

    我们过去用它做了一个 POC,我们发现有几个案例没有正确处理,这可能导致:

    • 悬而未决的测试,测试永远不会结束
    • 误报(测试被标记为失败,而没有真正的问题)
    • 许多 HLS 可能性未处理
    • 我们更不用说比 VOD 复杂得多且仅适用于极少数简单案例的直播。

    但由于它是免费的OSS插件,如果你有时间和能力了解java和jmeter,可以尝试自己提供补丁。

    我认为该插件可以处理非常简单的情况,但不适用于当前状态下的所有现实生活可能性。

    除此之外,模拟播放器如何向流媒体服务器请求 URL 是非常复杂的,因为您需要模拟暂停、播放视频、滞后...

    当然,通常当您想测试 HLS 时,您还想测试 mpeg-dash,至少这是另一个复杂得多的故事。

    最后,你通常需要custom metrics 来分析你的负载测试插件所缺少的。

    【讨论】:

      【解决方案2】:

      有两种可能:

      1. 你的视频流有一个bug,即m3u8播放列表引用了不存在的块URL,测试你是否可以使用普通的视频播放器播放视频,即VLC
      2. HLS 采样器插件中存在错误解析初始响应的错误。在这种情况下,请通过jmeter-plugins forum 联系插件开发人员。同时你可以使用普通的HTTP Request采样器到load test your HTTP Live Streaming service

      【讨论】:

      • 我已经尝试在 blazemeter 上使用 30 个线程用户的 HTTP 请求教程,没有错误。但是当我检查我的服务器(htop & nload)时没有流量。顺便说一句,我的服务器使用 Ubuntu 16.04。
      猜你喜欢
      • 1970-01-01
      • 2018-08-25
      • 1970-01-01
      • 2021-08-09
      • 1970-01-01
      • 1970-01-01
      • 2018-04-10
      • 1970-01-01
      • 2015-09-12
      相关资源
      最近更新 更多