Daniel NicolettiBrazil, São Paulo http://dantti.wordpress.com 48 Posts
Five months ago I announced the very first release of Cutelyst, a web framework powered by Qt 5. Time passes and I started shaping my real world applications written with it, I should probably release a newer version earlier but it's not very nice to keep releasing API that changes a lot, however next version (0.3.0) will still contains API changes. What changed from 0.1.0 to 0.2.0:
- I have setup a documentation website http://cutelyst.org
- I started a WordPress like blog written with Cutelyst https://gitorious.org/cutelyst/untitled this right now is a nice example app, if you like it please help :)
- Changed the API to expose the forked behavior thus being able to setup database connection in each new process avoiding a mess
- UWSGI got a patch to deal with workers that don't want to work, in other words when something on post-fork fails like reaching the dababase connection limit the worker can exit and won't be restarted.
- A bunch of bugfixed of course
- Make use of categorized logging (ie qCDebug)
- Allow for UWSGI to restart the application as soon as your application .so file changes, this greatly improve development speed :)
- Encapsulated the post body into a QIODevice subclass on UWSGI engine this means a QFile is --post-buffering limit is reached, or a custom IODevice that deals with the request memory buffer
- A parser to get uploaded content "multipart/form-data" which is fast and can work with lots of data
For the next version I'll try to get a properQt loop integration.
Release early, release often has never been my strength especially since I don't do a fair scheduling of all the projects I'm involved...
So since I was in need to better polish Cutelyst I took more time on it, and the result is great, around 100% speed up and a few new features added.
Cutelyst uWSGI plugin now has support for --thread, which will create a QThread to process a request, however I strongly discourage its usage in Cutelyst, the performance is ~7% inferior and a crash in your code will break other requests, and as of now ASYNC mode is not supported in threaded mode due to a limitation in uWSGI request queue.
Thanks to valgrind I managed to make a hello world application from 5K request per second on 0.2.0 to 10K req/s on 0.3.0 on an Intel Core2Duo 2.4Ghz (or 44K req/s on an AMD Phenom II 965 x4 3.4Ghz), however if you enable Grantlee templating you get around 600 req/s so if I happen to have time I will be looking into improving its performance.
Response::body() is now a QIODevice so you can set a QFile* of something else and have Cutelyst to send it back.
Now http://cutelyst.org points to a gitorious Wiki which is slowly getting populated, and API is available as http://api.cutelyst.org.
The 0.3.0 tarball can be downloaded here
Have fun :)
A bit more than one year after the initial commit, Cutelyst makes it's 5th release. It's now powering 3 commercial applications, the last one recently got into production and is the most complex of them, making heavy use of Grantlee and Cutelyst capabilities. Speaking of Grantlee if you use it on Qt5 you will get hit by QTBUG-41469 which sadly doesn't seems to get fixed in time for 5.4, but uWSGI can constrain your application resources so your server doesn't go out of memory (worth the leak due to it's usefulness). Here is an overview since 0.4.0 release:
- Remove hardcode build setting to "Debug", so that one can build with "Release" increasing performance up to 20% - https://gitorious.org/cutelyst/pages/CutelystPerformance
- Request::uploads() API was changed to be useful in real world, filling a QMap with the form field name as a key and in the proper order sent by the client
- Introduced a new C_ATTR macro which allows to have the same Perl attributs syntax like C_ATTR(method_name, :Path(/foo/bar) :Args)
- Added an Action class RoleACL which allows for doing authorization on control lists, making it easy to deny access to some resources if a user doesn't match the needed role
- Added a RenderView class to make it easier to delegate the rendering to a view such as Grantlee
- Request class is now QObject class so that we can use it on Grantlee as ctx.request.something
- Make use of uWSGI ini (--init) configuration file to also configure the Cutelyst application
- Better docs
- As always some bugs were fixed
I'm very happy with the results, all those site performance tools like webpagetest give great scores for the apps, and I have started to work on translating Catalyst tutorial to Cutelyst, but I realize that I need Chained dispatcher working before that... If you want to try it, I've made a hello-world app available today at https://gitorious.org/cutelyst/hello-world Download here!