Home / Archive by category "Non-Code"

IIS vs. Mono/Cherokee .NET web app response times

Some time ago I was testing how a Windows IIS powered backend would perform compared to the current Mono with Cherokee on Linux setup. The graphic shows the measured average response times. The switch to the Windows Backend was done shortly after 10PM. As you can see the average response times were significantly smaller afterwards.
Before there were 2 C3.XLarge Linux instances, afterwards there were 2 C3.Large Windows instances. So the IIS performed better in my setup on a smaller instance.

Switch Linux to Windows

Since this setup is also cheaper than the set of Linux instances, I am thinking about a permanent switch. I am also going to do comparisons using a different Mono setup. I will test Nginx as well as Apache.

Mono Key Duplication Error in High Traffic Environment Workaround

After setting up the Auto Scaling feature in the Amazon cloud to automatically fire up and terminate virtual machines, depending on how much traffic there is, I ran into some issues with Mono.

In my environment I run Mono 3.4 using the Cherokee web server on Ubuntu 14.

Apparently there is a bug (that actually should be already fixed according to http://lists.ximian.com/pipermail/mono-bugs/2013-May/113692.html) which leads to erroneous Mono instances when there is high incoming traffic during startup of that instance. The bad thing is that this instance of Mono will then not recover during subsequent calls, only killing the process helps. I saw two kinds of this error, one with key duplication for key “roleManager” and one for key “sessionState”.

The stack trace of the error looks like this:

In my web.config neither role manager config entries, nor session state entires were present. But each web.config used in your own projects derives from a global web.config (just like on IIS and Windows). The location for that global web.config on Ubuntu for .NET 4 web apps is /usr/etc/mono/4.5/web.config.
Commenting role manager and session manager in the httpModules section will actually fix the problem.

So the pitfall of this workaround is that you can only use it if your web app does not use sessions and is also not using the role manager / membership functionalities.

Thanks for reading, hope this helps somebody to get Mono very stable in a high traffic production environment.