During development of CppCMS I have always wanted to do some benchmarks against one of the most popular web development technologies: Asp.Net. I had found a blogging system: BlogEngine.Net that in its latest version had full support of mono under Linux, support of MySQL --- all I need to run benchmarks against CppCMS.
The beginning was promising. The instructions were simple, there was an actual blog running BE.Net under Apache mod_mono on Ubuntu. There were Linux specific instructions as well.
So, first of all I had installed mono 1.9.1 from Etch backports. The first problem I had to deal with was an installation problem --- the version of C# compiler and mono environment were different. This was solved quite simply. So, I could finally see BE.Net running under Mono using XML as data storage backend.
Then, I wanted to add MySQL storage backend. The problems had come very soon. The MySQL database script was written under assumption that table names are case insensitive. That was not true for MySQL under Linux. This problem was fixed.
Than I downloaded latest MySQL Connector\Net 5.2. I had strange error messaged and after asking at BE.Net forum I understood, what should I add to the configuration in order to make mono work with MySQL. The original error message had been fixed, the next one come.
I had to replace Connector\Net 5.2 with 5.1. For some wired reason the latest version refused to work with mono. Finally, after long battle, I could see my MySQL powered BE.Net.
That was almost good. However, in order to make fair comparison of CppCMS and ASP.Net I should enable caching. Good suggestion was given me at this forum: adding following line at the header of aspx file should help me.
<%@ OutputCache Duration="20" VaryByParam="None" %>
I'd done it --- no result! The performance is the same. After googling for a while, I had found this FAQ at mono site. I did as explained --- still no effect.
Ok, probably I had understood anything in ASP.Net, so I get to work and created a simple page that displays current time. If caching is enabled, refreshing the page should not effect the displayed time for a while. If the cache does not work, the clock will be updated.
I tested this in VS2005 and under IIS --- works perfectly well. So I got home with this project and run it under mod_mono --- cache does not work! Lighttpd+FastCGI --- same, no cache.
Ok, anyway I did some benchmarks at work and I had seen that, this simple clock gives me about 750 pages per second for cached variant and 650 for non cached one. The tests were done under IIS 5.0 on Dual Core Pentium D 3G.
The same code at home with mod_mono (under Signle Core AMD Athlon 3000) had given me 350 pages per second. Next run had given 300, next 200 and next 150...WTF??? Same behavior was observerd under ligttpd and fastcgi. So, I remembered this post that pointed at exactly same problem.
Conclusions: mono is still far to be production ready platform for APS.Net under Linux. I'm going to look for something with JSP and Java for such benchmarks --- it is JIT as well.