Minimum Response Time Tuning

38 views
Skip to first unread message

Mark Graves

unread,
Feb 10, 2014, 8:00:54 AM2/10/14
to web...@googlegroups.com
Hey Everyone,

I'm deploying a web-service app which will require sub second response times.  

The code is entirely written in python and the algorithm to compute the output takes approximately .3 seconds.

Will web2py's overhead be too much to deliver the response time I need?  

Should I consider deploying behind Flask since I don't need anything but request headers and a JSON body?

The algorithm code is entirely contained within a module which is imported and then run on some request.vars but I'm still having trouble tuning it up.

Any suggestions are greatly appreciated.

Thanks!

Mark

Massimo Di Pierro

unread,
Feb 10, 2014, 9:44:43 AM2/10/14
to web...@googlegroups.com
Hello Mark,

you say the code takes 0.3 seconds. Is this the algorithm or the overhead that you are trying to eliminate. If that is the algorithm, rewriting in a different framework will not help you. If that is the overhead, that is definitively too much. Probably you are executing something that should not be executed, for example the models.

Hard to say without looking at the code.

Based on my experience, the web2py overhead without models is ~5-10ms. This is because of cookie parsing, client headers validation, session handling, and checking the file system for models. If you do not need any of this and you need sub ms performance, I'd recommend bare bone tornado or gevent. You do not need a framework.

Massimo

Mark Graves

unread,
Feb 10, 2014, 9:55:53 AM2/10/14
to web...@googlegroups.com
Thanks Massimo,

This is the algorithm.  If the web2py overhead is 5-10ms, I can probably will stick with it.

Thanks for the suggestions!

Mark


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/2UzdfRmr258/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages