Sunday 22 September 2013

The First step to Change is Understanding

To enhance anything, we first need to completely understand it. Inside out.
Only then can we make sure that the enhancements augment the preexisting model perfectly.

Our first encounter with boa was in the classroom, although a brief one, it implored us to explore..

To bring about a change, we also need to know why it is imperative to do so and hence understand the shortcomings of the current paradigm.
Having already learnt about the different approaches to building a scalable web server, we concluded that boa, being implemented using the select approach, did have some limitations inherent to the model itself.

The select( ) system call, is not entirely scalable, which is as a consequence of the limit imposed on the number of clients - indirectly by the size of the fd_set, which generally is 1024.
It takes a state based approach that makes the kernel maintain the entire set of file descriptors.
To determine the file descriptor of interest (file descriptor on which data has been received / the one to which data has to be written to), this set has to be scanned in its entirety. This is time consuming and inefficient as the result sets are mostly sparse.

The epoll( ) system call in Linux and kqueue( ) in BSD can be used for overcoming the aforementioned overhead.
The epoll mechanism essentially lies in between that of an event based approach and a state based one. It does not set any limit on the maximum number of connections. It is also considered better in terms of performance as compared to the select based approach.
The major performance enhancement comes from the fact that the epoll system call relies on the arrival of events on particular file descriptors and does not scan the entire set of fds linearly. It also supports two different modes of operations: edge triggered and level triggered.
The kqueue approach, though is very similar to that of epoll, provides a further increase in performance. It allows multiple updates of the specified set in a single system call.

Having looked at into why something has to be changed, we decided to look into what exactly had to be changed and most importantly, things that have to be left unchanged because - Change for the sake of change is not always a good idea!

Sunday 15 September 2013

Background check

Before deep diving into the server and its architecture, I decided to first look at existing enhancements or latest changes made to it. Along with that, the timeline as I could figure out was pretty interesting.

First look at the boa website [1] lead me jumping to a premature conclusion that the server had faded away in the background as long back as in 2005.
The first official release of boa was in 1996 and after that it did have many revisions and versions, the latest being in 2005.

But what happened after that? Did it lose its importance in the computing world as other better servers came up and Google gave fewer results of boa, the web server when the phrase 'boa' was entered..?
At least it still did appear in the top 5 alternatives to the Apache web server if that was any consolation.
The web exploration of boa the web server was made even more tougher with other popular services being named boa, thankfully they were not web servers!

But boa, being the web server it is, has not lost its relevance. Having low memory requirements and working wonderfully on smaller machines, boa is still operational.
Here are a few pretty recent papers to prove this fact :
i. Design and development of embedded web server based on Arm9 and Linux [2]
ii. The Transplantation of BOA [3]

The papers describe how boa can be transplanted to embedded devices to perform tasks such as network monitoring and for a variety of intelligent appliances based applications. The prospects of an embedded web server are now wider is what the papers also seem to claim.

It is gratifying to know that boa is taken into due notice for various applications and also is one of the foremost contenders for embedded applications.

There is another thing I came across more recently. We are all aware of the hype surrounding any android application. I was elated to find out that the humble web server had an equivalent app for it too [4].

This made me finally conclude that boa was definitely in the game and after all not a wrong choice to spend some time on!


[1]Official web site http://www.boa.org/

Boa is not dead, not yet!

[2] Design and development of embedded web server based on Arm9 and Linux
[3] The Transplantation of BOA Based on Linux3.0.1 and S3C6410
[4] Android app

The beginning: Boa Log (Bloag)

Boa...
The first time I heard of it, least did I know it would get associated in a manner that the server would continue dishing out pages to me forever.

When I initially learnt about boa, along with a couple of other web servers, the thing that fascinated me was the size of the code. It reminded me of 'Small size, big impact' things.

Whenever software such as a web server is discussed, we do not imagine it to be less than 10k lines. But boa, is different. It is sleek and leaves behind a small footprint.

Its limited functionality might not have made it huge in the market, but it is good at what it was actually made for.
Being lightweight, it is extremely useful for embedded applications. It is a tiny web server that also offers high performance.