IIS URL Rewrite 2.1 extension memory leak

by Dunge   Last Updated August 14, 2019 18:04 PM

I had the issue that visiting my website using the IP address instead of the hostname, it would display a certificate error because the certificate is issued to the domain name only. Searching a bit on this, I found out that doing and url redirect seems to be the common method to fix this issue. For example, redirect to https://google.com.

So using the URL Rewrite module, I wrote this rule which seems to work:

            <rule name="IP to domain" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
                <match url="(.*)" />
                    <add input="{HTTP_HOST}" pattern="((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" />
                <action type="Redirect" url="https://example.com/" appendQueryString="false" />

About 12hours later in the middle of the night, production server crashed and everyone panicked. "IIS Worker Process" (w3wp.exe) which usually hover around 1.5gb usage took the whole 16gb of the machine.

Restarting the site clear the memory, but it still raise rapidly. Disabling the rewrite rule stop the memory usage.

I then found this article about a memory leak in the extension, but it was for 2.0 and I'm using 2.1.

Related Questions

What is memory cache? And how to use it?

Updated September 27, 2016 09:01 AM

Javascript Memory Issues

Updated June 23, 2019 13:04 PM

Can I set memory limits on cpanel acounts

Updated June 17, 2016 08:01 AM

alternative to memcached

Updated November 03, 2016 09:01 AM