Home / Hosting / Optimizing Mono FastCGI running on Ubuntu / Cherokee Webserver

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.

One thought on “Optimizing Mono FastCGI running on Ubuntu / Cherokee Webserver

  1. 83Maxine

    08 Aug on 2017 at 1:04 am

    Hi blogger, i must say you have very interesting posts here.

    Your website can go viral. You need initial
    traffic boost only. How to get it? Search for: Mertiso’s tips
    go viral

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">