Monkey v1.4 : Spider Monkey is out!

after four months of work i am pleased to announce that Monkey HTTP Server v1.4 with code name Spider Monkey have been released.

For short description changes please refer to the following announcement page:

http://monkey-project.com/Announcements/v1.4.0

This version brings interesting core changes that aim to improve general performance and a better development experience. Let's describe some niet features.

Shared File Descriptors

This is a great general improvement in the server, basically the idea is that when facing requests for the same resource under a Virtual Host context be able to share the same opened file descriptor.

A simple example would be: imaging that you are getting 500 concurrent requests over the same static file (mapped under the same VirtualHost), instead of perform 500 open(2) system calls, just share the file descriptor. This is a huge gain because you were able to reduce the number of file descriptors required by the server, be a small device or a big server this is a real improvement.

The technical implementation is through a HashTable (HT) per VirtualHost, the HT can hold up to 64 entries and each one up to 8 chains in case of collissions, that give us the chance to store a maximum of 512 shared file descriptors.

When a file is going to be opened, the VirtualHost routines checks if the file is already open, if so, just use the same File Descriptor (FD) and increase a counter that represents the readers. When some connection instruct to release the FD, the VirtualHost routine checks if is a shared FD or not, if it is, just decrement the readers counter and if it reach zero, perform an explicit close(2). If its not shared, just close it directly.

This feature is enabled by default but can be disabled any time through monkey.conf configuration file under the key FDT, e.g:

[SERVER]
    FDT  Off

Linux Trace Toolkit (LTTng)

The Linux Trace Toolkit (LTTng) is an excellent tracing tool for the Linux Kernel and it also provides a user-space version.

This version of Monkey implements LTTng to perform on-demand traces over the Scheduler en Pooling interfaces, of course this is an optional feature for debugging and development purposes and is not something to be used in a production environment.

To enable Monkey + LTTng a new configure script argument called --linux-trace have been added:

$ ./configure --linux-trace

Jemalloc Memory Allocator

the common GLibC memory allocator is not well suited to be used when running servers, because of memory fragmentation, scalability problems on multi core system and others.

After analyzing different open options, i found that Jemalloc solve many of GlibC problems and is widely used in the Servers world:

https://www.facebook.com/notes/mysql-at-facebook/using-jemalloc-to-fix-a-performance-problem

The good thing is that also Jemalloc provides a statistic interface so it's possible to track memory used per thread scope thanks to it's Arena's design.

From now Jemalloc is the default memory allocator that is compiled statically into Monkey, so the compiling time will take much longer than previous versions.

As Monkey tried to be flexible, this change is the default one but also it's optional, you can back to the default system memory allocator configuring Monkey with the option --malloc-libc:

$ ./configure --malloc-libc

Proxy Reverse Plugin (experimental)

thanks to the work done by Nikola Nikov on the past Google Summer of Code program, we have an experimental Proxy Reverse plugin. This is really good news so we expect to make this plugin in a stable stable (and default) on the incoming v1.5.

To enable this plugin when compiling from sources the following options are required:

$ ./configure --enable-plugins=proxy_reverse

Secure Socket Layers (PolarSSL 1.3)

Sonny Karlsson have improved the PolarSSL plugin so it nows support also newer versions of PolarSSL Library 1.3.x.

There is no specific requirements to make this work as on compile time the Plugin will use the right API depending of the installed version.

License: LGPL v2.1

From now all Monkey Core and Plugins distributed as part of the sources have been moved to LGPLv2.1.

We are still evaluating a possible change to a more flexible License.

Github

Collaboration matters and have the right tools helps to decrease the entry level difficulty. Also as Monkey and Duda I/O are a complete HTTP development stack, many people depends of our GIT repositories to build their development and deployment environment, so for stability and speed we moved all our repositories to Github:

http://github.com/monkey

From now all collaboration with Monkey Project related software will be done through Github channels: issue tracker, pull requests, comments, etc.

Our Trac instances have been migrated to Github too, so the address http://bugs.monkey-project.com and http://bugs.duda.io redirects to the project Issues pages on Github.

Blog: from Wordpress to Ghost

as you can see you are reading this in a new Blogging system: Ghost. Wordpress is difficult to maintain and to write, as Ghost said "Wordpress is not longer for Blogging" and we agree.

The good thing about Ghost is that all posts are written in Markdown format, so its easy to write and easy to deploy.

What's next ?

a lot!, we are working to join Google Summer of Code again this year so if you have any ideas to propose or want to become an Organization Mentor (in case we are accepted), feel free to join us.

We started the development phase of Monkey v1.5 and the main focus for this next round is to have an improved testing infrastructure and of course keep moving forward on improving performance.

On the Duda I/O side we have reach the point where we need to start maintaining stable branches as a couple of companies are running their services based on Duda, so API stability is a must and we must do it right from the beginning.

As usual you can reach us on Freenode #Monkey channel or through our mailing lists. Also you can follow us on Twitter.