IIS memory issue for reverse proxy for MJPEG stream

Emanuel Hillberg 1 Reputation point
2021-04-15T09:32:29.187+00:00

As topic.

I have set up my IIS (v 10.0.14393.0) with rules for a specific path to distribute a MJPEG stream I have locally on port 8081.

In a web page I have included a link to the specified path, <img src="/testfolder/videos/test.jpg'"></img>

It all works, but after loaded for a while the w3wp.exe process dies. (When looking in task manager I can see the memory used grows...)

I think this is because IIS caches all the images, but I am not sure.

I have asked this question before on the forums and only was adviced to do log of the problem. However reading and understanding the log did not do anything for me.

To set -up and see the issue:
Web structure:

webroot/

webroot/testfolder/videos/

webroot/testfolder/index.html

webroot/testfolder/web.config

web.config:

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Reverse Proxy To videostream" enabled="true" stopProcessing="true"> <match url="^videos/(.)" /> <action type="Rewrite" url="http://2.248.130.108:81/mjpg/video.mjpg" /> </rule> </rules> <outboundRules> <rule name="Reverse Proxy Outboundrule to videostream" preCondition="ResponseIsHtml1" enabled="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, Img, Link" pattern="^http://2.248.130.108:81/mjpg/video.mjpg" /> <action type="Rewrite" value="/testfolder/videos/test.jpg" /> </rule> <preConditions> <preCondition name="ResponseIsHtml1"> <add input="{RESPONSE_CONTENT_TYPE}" pattern="^(.)" /> </preCondition> </preConditions> </outboundRules> </rewrite> </system.webServer> </configuration>

index.html:

<img src="/testfolder/videos/test.jpg"></img>

I hope this is a configuration issue. It feels like the MHPEG is being cached by IIS somehow. (And I don't want that)

Kind regards, Emanuel

Internet Information Services
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sam Wu-MSFT 7,036 Reputation points Microsoft Vendor
    2021-04-16T07:25:01.427+00:00

    Hi @Emanuel Hillberg

    You can use the Microsoft debug diagnostic tool to capture a hang dump to analyze the memory issue.

    About how to use the Microsoft debug diagnostic tool to create a rule in Debug Diagnostic to automate a dump you can refer to below links:

    debug-diagnostic-2-0-creating-a-memory-leak-rule-unmanaged-code

    https://stackoverflow.com/a/44867575/13336642


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Sam Wu-MSFT 7,036 Reputation points Microsoft Vendor
    2021-04-26T08:03:36.4+00:00

    Hi @Emanuel Hillberg

    To analyze the dump file, follow these steps:

    1. Click Start, click Run, type the path of the Debug Diagnostics tool, and then click OK. Note By default, the Debug Diagnostics tool is located in the C:\Program Files\DebugDiag folder.
    2. On the Advanced Analysis tab, click Add Data Files.
    3. Locate and then click the dump file that you want to analyze, and then click Open.
    4. On the Advanced Analysis tab, click Crash/Hang Analysis, and then click Start Analysis.
    5. Review the report that is displayed in Microsoft Internet Explorer. A copy of this report is also stored in the \DebugDiag\Reports folder.

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Emanuel Hillberg 1 Reputation point
    2021-05-07T10:37:45.997+00:00

    Hello @Sam Wu-MSFT

    Sorry for not answering.
    When using CrashHangAnalysis I dont really get any errors... (I actually think this is an config problem)
    Heres a part of the log:

    Client Connections

    Client connection from 10.105.1.85:61653 to 195.252.7.185:443
    Host Header localsite:443
    GET request for /videoproxy/streamproxy/10.105.3.195.jpg
    HTTP Version HTTP/1.1
    SSL Request True
    Time alive 00:11:42
    QueryString
    Request mapped to
    HTTP Request State HTR_READING_CLIENT_REQUEST
    Native Request State NREQ_STATE_PROCESS
    HTTP Headers Accept: image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.8
    Accept-Encoding: gzip, deflate, br
    Accept-Language: sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7
    Host: 127.0.0.1:8081
    Max-Forwards: 10
    Referer: https://localsite/HTML5/videotest_5_RC1/
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
    sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"
    sec-ch-ua-mobile: ?0
    Sec-Fetch-Site: same-origin
    Sec-Fetch-Mode: no-cors
    Sec-Fetch-Dest: image
    X-Original-URL: /videoproxy/streamproxy/10.105.3.195.jpg
    X-Forwarded-For: 10.105.1.85:61653
    X-ARR-SSL: 4096|256|C=SE, O=XXXXX, CN=SITHS Type 3 CA v1|C=SE, L=XXXXX, O=XXXXXX, CN=localsite, SERIALNUMBER=XXXXXX
    X-ARR-LOG-ID: adb967f8-6485-45ab-ad36-593d4b47a6c4

    19 connection(s) waiting for the next request.