Took a look at the rsn (profile), and yes, almost 99% of the time is
spent in `select.select` . This happens to be:
https://docs.python.org/2/library/select.html#select.select . Guessing
something to do with the network setup ... not sure though.
The issue doesn't seem to be with your application's code.
Btw, did you try this setup on a VirtualBox / VM , before replicating it
on the Pi?
Maybe a nginx+web2py setup should circumvent this issue.
Do keep us posted on what you find.
________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
On Wed, 15-02-2017 1:12 AM, 'Andy Key' via web2py-users wrote:
Good evening everyone,
thanks for the kind responses! I was able to check out some of your
ideas. All this fixes have been carried out within the mentiond Lighty
environmend (Lighttpd 1.4.35 + web2py Raspbian 4.4.38-v7+):
- I turned off migrations and set reload=false in the db.py file
- I haven't removed all the auth and mail stuff, cause I'am planning
to use these features. But for now session.forget() was applied to my
scripts
- I tried Pre-Compilation already before, but did it again yesterday:
no impact.
- It was not possible to use response.json(ret) directly, for any
reason my jquery script doesn't accept the header of the returned json
file. I haven't analyzed that problem in detail why this happens, but
I think thats not the point. The python process shows the same
behaviour with or without this change.
- I installed RunSnakeRun and started the fcgi process via
|
sudo -u www-data python -m cProfile -o rsn fcgihandler.py
|
I attached the resulting output file, which I was able to open the rsn
file in my Ubuntu 16.10 VirtualBox machine. I can't guess what
this<select.select> entry means? Python seems to spend a lot of time
there, right?
A new error showed up in the console with the fcgi process started
("broken pipe"). I think it's a result of the not-responding python
process: http://pastebin.com/j9pZAWU2
The next step is to try nginx and gdb... I hope I can start to
implement this scenario tomorrow evening.
Am Montag, 13. Februar 2017 17:58:13 UTC+1 schrieb Leonel Câmara:
raspberry pi 3 should be more than enough to run web2py I have it
running an N64 emulator.
I do recommend you go with nginx/uwsgi instead of apache or
lighthttpd.
Looking at your code I find nothing that could cause this but I do
have a few recommendations:
You could add session.forget() to your controllers since you don't
care about session. You could also simplify things, so:
|
defget_overview_values():
fromgluon.serializers importjson
livedata =db(db.ec_livedata.id
>0).select(orderby=~db.ec_livedata.id,limitby=(0,1)).first()# get
last entry of ec_livedata
ret ={
'V_ist':livedata['V_ist'],
'f_fu':livedata['f_fu'],
'dp_4':livedata['dp_4'],
'fuellstand':livedata['fuellstand'],
}
returnjson(ret)
|
Would become:
|
defget_overview_values():
session.forget()
livedata =db(db.ec_livedata.id
>0).select(orderby=~db.ec_livedata.id,limitby=(0,1)).first()# get
last entry of ec_livedata
returnresponse.json(livedata)
|
Another big improvement you could make would be to turn off
migrations in your appconfig.ini and then set reload=False for
AppConfig.
Then remove all Auth and Mail stuff from db.py since you don't use
them anyway.
Then compile your app.
If you make all these changes you application should be extremely
fast.
That said this is probably a bug with the way you're running
things and I think you will only fix it by going the
nginx/uwsgi-emperor route.
--
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+unsubscr...@googlegroups.com
<mailto:web2py+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.