Skip to content

bootandy/python-frameworks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

*** This project has got too messy - I need to summarize and refine it ***

Notes:
-------------

This is a 'real world' test of python frameworks talking to mongodb.

I am not loading any static files (css / js) etc - NginX can serve them staticly.

I am querying MongoDB and displaying the results as a simply layed out webpage.

MongoDB is run on the same box as the python framework. 

Would have liked to test Gevent on django as well but it is giving me grief.

Tests run by TestPlan.jmx in JMeter - see Results.txt

Frameworks to Test:
-------------
Async Tornado     [Request and DB call done Async]
Sync Tornado      [Request and DB call done Sync]
Hybrid Tornado    [Request is Async. DB call is Sync - This is what Tornado docs recommend with My-SQL]

Async Twisted
Sync Twisted

Django + mod_wsgi


Data:
------

Included in data-loader/ is a python script that loads London houseprices from Zoopla. This fills mongodb with a load of data which simulates a more 'real world' test



Learned:
-------------

Dont use reg ex in mongo queries they are __slow__

Dont table scan mongo - but if you have to create an index

Twisted as a web framework is not pretty.

Async Mongo Drivers are faster than Synchronous Mongo drivers. Although they do not support all the functions that the Synchronous PyMongo driver does.

Django is marginally slower than Twisted/Tornado using async drivers. 

Django is notably slower when compared against a 'hello world' webpage that does not hit the database.

Tornado is faster than Twisted for querying MongoDB. Twisted is as good as (or better than) Tornado for non database 'hello world' page generation and for simple 'get by ID' queries. I suspect that Twisted's Mongodb driver is not as good as Tornado's.

TODO:
-----------
Run tests with MongoDB on different PC
Test Gevent

Requirements
-------------
requirements.txt

You need python-dev: apt-get install python-dev
You need this for async Twisted mongo: https://github.com/fiorix/mongo-async-python-driver

About

Testing python frameworks with mongodb. (tornado, twisted, django)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published