Tuning app performance for good response times on slow servers

475 views
Skip to first unread message

BlueShadow

unread,
Feb 25, 2014, 11:12:12 AM2/25/14
to web...@googlegroups.com
Hi,
I'm using web2py with nginx and sqlite. And my response times are pretty bad. last time I measured it I god results around 2000ms.
When I use google pagespeed it tells me three things I should improve: use browser caching for images, put javascript and css below the fold and check the content management system for known bottlenecks ...
The first two I got no clue how to do them or what it means putting something below the fold.
Are there any known bottlenecks and fixes for them?
regards

黄祥

unread,
Feb 25, 2014, 11:17:24 AM2/25/14
to web...@googlegroups.com

Niphlod

unread,
Feb 25, 2014, 2:50:15 PM2/25/14
to web...@googlegroups.com
Every efficiency trick brings down considerably the response time, but usually you'd start from  < 400 ms response times to go lower, maybe arriving at < 100 ms

2 full seconds is so much that it's not web2py the one you should look at.... it's your app's code.


Kevin Bethke

unread,
Feb 25, 2014, 3:22:38 PM2/25/14
to web...@googlegroups.com
thecode can't be that bad. Can it?
> --
> 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/fxcPflpF63o/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.

Niphlod

unread,
Feb 25, 2014, 5:03:33 PM2/25/14
to
try yourself. Take the welcome app from 2.8.2.
If /welcome/default/index takes more than 50ms to be served, then it's the server/web2py config.
My laptop of 4 years ago with Ubuntu 12.10 loads the page in 22ms with the rocket webserver.
First round of fetching static assets with an empty cache takes it to 360ms.

EDIT: pythonanywhere, a hosting provider that surely doesn't shine on performances (free account), assures 320ms (tested from home, Italy). 64ms are for DNS lookup, 228ms to transfer the data. This leaves roughly 30ms to generate the webpage.

EDIT2: harsh summary:
- if your app on your local machine on the internal webserver renders any page taking more than 500ms, touching the config is not where I'd go first to assure good response times on your production server
- even if 500ms are achieved on your local machine and your prod server takes 2000ms with the exact same setup, then your prod needs to go to wasteland

Michele Comitini

unread,
Feb 26, 2014, 11:10:54 AM2/26/14
to web...@googlegroups.com
check that there is not a problem with your dns setup where web2py runs.
use the profiler to find out it can give you some good hints.



2014-02-25 22:49 GMT+01:00 Niphlod <nip...@gmail.com>:
try yourself. Take the welcome app from 2.8.2.
If /welcome/default/index takes more than 50ms to be served, then it's the server/web2py config.
My laptop of 4 years ago with Ubuntu 12.10 loads the page in 22ms with the rocket webserver.
First round of fetching static assets with an empty cache takes it to 360ms.

--
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 the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Kevin Bethke

unread,
Feb 26, 2014, 11:14:38 AM2/26/14
to web...@googlegroups.com
what do you mean by profiler?
thanks
> 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/fxcPflpF63o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Michele Comitini

unread,
Feb 26, 2014, 3:50:13 PM2/26/14
to web...@googlegroups.com
$ pip install RunSnakeRun
$ mkdir /tmp/w2prof
$ python web2py.py -F /tmp/w2prof

access to the slow page on web2py with the browser a few times

$ runsnake /tmp/w2prof/*





Reply all
Reply to author
Forward
0 new messages