One more thing.... because of design flask with generate and reuse pyc file. In the case of web2py python code is executed. You have to explicitly "bytecode compile" via admin. I am not sure if you have done that.
Massimo On Jul 21, 3:36 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > Hi Thadeus, > > I looked at the code you used for comparing web2py and Flask. > > This is NOT A FAIR COMPARISON > > Here is why: > > 1) you did not set migrate=False in web2py. This means at every > request you lock the entire database table metadata to check whether > the table has migrated. You do this while you have an open transaction > with the postgresql database. For such short code, this essentially > serializes all your requests. You should run it once with migrate=True > and then run the tests with migrate=False. > > 2) in the case of Flask you use raw SQL for the queries. In the case > of web2py you use DAL syntax. On such a short program I cannot say > what the DAL overhead may be but certainly you have it in one case and > not the other. > > 3) The web2py program has sessions enables (has to parse cookies, > create and parse session files, store the session, files, generate new > cookies and lock session files - at every request). You did not even > set session.forget() which means a new session file is saved at every > http request. The Flask program is doing nothing of this. > > Of course the Flask program under this conditions performs better. > > A more fair test would be: > 1) set migrate=False in the web2py code > 2) use SQLAchemy syntax for database queries in the flask code > 3) enable serverside session in Flask code > > Massimo > > On Jul 18, 12:20 pm, Thadeus Burgess <thade...@thadeusb.com> wrote: > > > Massimo, web2py.com is not a valid application to be testing this on. Most > > of what web2py.com does is just render a template and display it, it hardly > > does any kind of strenuous dbio. > > > As you know I have a few separate servers running different configurations. > > > I mainly decided to do this testing as to the problems I have had with my > > application at work (which runs apache + mod_wsgi). I wondered if my blog > > had the same issue (which when I ran ab tests on it and spiked its usage, it > > did). Interesting thing is my blog ran on cherokee + uwsgi. I doubt it is a > > configuration issue since I still have the same problem on two completely > > different apps running completely different setups all different except > > web2py. They both use postgres as well. > > > I am attaching the two apps that I tested, as well as a text file that > > contains the raw ab tests that I collected to run > > > -- > > Thadeus > > > On Sun, Jul 18, 2010 at 4:39 AM, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > Last week I run some tests. I can confirm I have NO dropped requests > > > on web2py.com running with the recommended configuration (apache > > > +mod_wsgi 3.1). > > > > Here is the httpserver.log for 3 days of running (I removed the IPs > > > from the logs and requests for static files served directly by > > > apache). > > > > http://www.web2py.com/examples/static/logs.txt > > > > You can see that most pages are served in about 50 millisecond and all > > > of them return a 200 OK. > > > > At 2010-07-08 16:58:22 I also run a test and you can see the logs for > > > that. No propped request from ab. > > > > Clearly something is wrong with Thadues setup. I cannot help debug > > > this if I cannot reproduce the problem. > > > As soon as I have some time I will install uwsgi and try it. > > > > @Thadeus. Can you post the application you used for testing? > > > > Massimo > > > AB_WEB2PY_FLASK.tar.lzma > > 1011KViewDownload > >