Thursday, November 20, 2008

Pylons for FAPWS2

There was a question on my blog about FAPWS2 and Pylons. I was able to post a comment about it in the entry however I was trouble because I could not get a patch to the maintainer of FAPWS2 however William published FAPWS2 on github (http://github.com/william-os4y/fapws2/tree/master). It has then motivated me to create an account and contribute my personal contributions to the project. Which you can find http://github.com/lateefj/fapws2/tree/master. At the moment I have been able to just add a Pylons example on configuration. Mainly there is a run.py and development.ini that where modified to support Pylons. Last time I benchmarked it the performance was around 30% increase.
Next commit is I want to integrate my Frisky contributions into FAPWS2 this would help to see if I can get other to find out if they are getting the same performance with the caching utilities, static folder configuration (WSGI application are slow at serving static files). Just sent off email to make sure all the features I am proposing are sane. Can't wait to start hacking on it!

3 comments:

Marko Manninen said...

What do you think, how much it would take to use libevent with web2py framework? I'd like to experiment with it, but don't know where to start. At the moment web2py uses cherrypy wsgiserver: http://code.google.com/p/web2py/source/browse/trunk/gluon/wsgiserver.py

Lateef Jackson said...

Pretty easy I would guess. The main thing is you probably don't want to write a C module. The performance is probably not so much worth the time and effort. You could use pyevent (http://code.google.com/p/pyevent/) which is python library that uses libevent. If you just want to integrate web2py with FAPWS then that would be pretty easy.

There is another option :) I wanted to create a WSGI server that could use asyncore or other (libevent libev, ect) system. So I create this: http://www.bitbucket.org/lateefj/frisky/. It has some basic pylons support but if you proded me I would probably clean it up and add support for web2py. I was getting like 3K req/sec (raw) so it is very fast and does not require 3rd party C code. Even though it runs half the speed FAPWS2 it is still mind blowingly faster than most webservers.

Marko Manninen said...

That was interesting project as well. C library makes extra hassle, so using frisky could straighten some ways. I saw POST and GET methods handled there, but in which part of the server / web application file uploads (coming from forms) are normally handled?

Last year i made one project with Pylons, but recently used web2py and found it more practical for my projects. As a hobby, train and curiosity im thinking, if i could do little hacks with backend servers.

I found you using FAPWS2 with pylons and it seemed rather simple to implement, and that made me to ask opinions from you, if that simplicity would apply to web2py too.

Thank you for you comments.

Post a Comment