Slow TTFB debugging with Wing IDE

73 views
Skip to first unread message

MDSIII

unread,
Apr 7, 2016, 2:46:16 PM4/7/16
to web2py-users
Running web2py from the Wing IDE, so using the built-in rocket server, I see long Waiting times in Chrome Dev Tools for my ajax requests. I'm getting times in excess of 6 or 8 seconds.
This is a single page application that fires off a bunch (7 or 8) ajax requests after the initial page load. I'm not sure how to confirm it but it seems as though the server is handling these requests serially.
When I make a request to one of these long wait controller functions singly (either non-xhr or with xhr) it returns pretty quick (< 1 sec.).
If I start web2py from console I don't see these long wait times.

I'm pretty sure this is due to how wing manages worker threads but I'm hoping someone here also uses Wing for development and knows why this happens and a "fix". I don't remember it always being like this on previous versions.

Using wing 5.1.10
and web2py 2.13.4

Thanks,

Niphlod

unread,
Apr 7, 2016, 3:04:41 PM4/7/16
to web2py-users
IMHO it's just sessions being locked to prevent concurrent modifications. 

if your ajax requests aren't using the session, put a 

session.forget(response)

at the top of your function.

MDSIII

unread,
Apr 7, 2016, 3:12:13 PM4/7/16
to web2py-users
Thanks for the quick reply Niphlod. That was the first thing I tried but it didn't help. Am I doing forget() correctly if I read a session attribute and then call forget but never write to the session (until later of course)?

Something I forgot to mention, some, but not all, the controller functions access the DB (sqlite) but just read.

Niphlod

unread,
Apr 8, 2016, 4:27:54 AM4/8/16
to web2py-users
just call session.forget(response). You can read from the session as you like.
session.forget() isn't going to add concurrency, it just not saves the session even in the event it got modified....but it still locks.

Max Slimmer

unread,
Apr 13, 2016, 4:51:01 PM4/13/16
to web...@googlegroups.com
I'm doing that with sessions.
I'm pretty sure this is something to do with the IDE. I'll keep investigating.

--
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/Hf_HtBX9r6M/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/d/optout.



--
--Max III
Reply all
Reply to author
Forward
0 new messages