Wsgi-Boost-Server: A Python WSGI Server Written in C++

 July 15, 2016     0 comments

At last I found some time to write about my recent project — WsgiBoostServer. I started it to learn C++ and, specifically, writing binary extension modules for Python using Boost.Python. As the name implies, this is a WSGI server, that is, a HTTP server for Python web applications. But in addition to Python applications WsgiBoostServer can also serve static files that allows to use it for serving standalone Python micro-services with all their static content.

Because WsgiBoostServer is written in C++ using Boost.Asio library, it is faster than pure Python WSGI servers like Waitress or CherryPy. And since it can be used as a regular Python module (although binary), it does not require complex set-up and can be included in any Python application. More info about WsgiBoostServer and its source code can be found in my GitHub repository. It's MIT-licensed so feel free to use it as you like if you find this my little side-project interesting.

Update: Unfortunately, deeper testing revealed serious problems. WsgiBoostServer works with pure-Python WSGI applications without problems but crashes because of memory corruption if I add some binary Python modules in the mix. My guess is that Boost.Asio does not work well inside a Python interpreter which does its own memory management. Since diagnosing such arcane memory problems is way over my head, I had to abandon this project frown.