Home / Posts tagged "cherokee"

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.

Optimizing Mono FastCGI running on Ubuntu / Cherokee Webserver

For an online game I am running Mono in the Amazon AWS cloud on several c3.large instances. Those instance types have 2 virtual CPUs. Today I experienced a little downtime of the game and found that none of the servers was working at their full capacity. Mostly only 25% CPU was used. The database servers could not be the bottleneck as the following charts showed.

Loadbalancer Request Latency
This diagram shows the average latency our load balancer in AWS encountered while serving the requests. As you can see there is a spike up to 12 seconds at around 13:45.

WebServer CPU usage
This diagram shows the CPU usage on one of our web servers (the others were similar). At around 13:45 a spike of around 40% CPU usage can be found, not nearly at the servers capacity.

Database Server CPU usage
This chart shows the CPU usage of the master database server. Also not nearly at it’s full capacity. Since we already invested quite a lot of time into optimizing the database server, I know that it is possible to max it out and found that this could not be the bottleneck.

In our current configuration the Cherokee WebServer is configured to access one Mono FastCGI source. This apparently rather inefficient. So in order to get better results I added 3 more FastCGI sources basically allowing Cherokee to load balance now between 4 FastCGI sources. I cannot yet confirm that the servers capacity is not used better, but I will update this post as soon as I can.

The cherokee configuration looks now like this:

Each FastCGI process is listening on its own port. Now in order for Cherokee to load balance between the sources, the following is needed in the configuration:

This tells Cherokee that the default handler of my default matching rule of our virtual server should use the information sources 1 to 4 and load balance between them.