Thank you for your time Anthony, I think I've found the root cause of the
issue.
Based on your last questions, I checked but there were enough available
uwsgi workers. However I remembered my deploy involves a pooler for
database connections (I use pgbouncer for postgres), and I have a pool size
of only 1 connection per application. So I set a higher pool size, and then
it started to work. I think that the bottleneck was there, in the database
access, regardless of the session.forget(response).
Sorry having bothered you with this.
Thank you very much, as always.
Best regards,
Lisandro.
El lunes, 18 de diciembre de 2017, 0:54:45 (UTC-3), Anthony escribió:
>
> How many uWSGI worker processes/threads? Is it possible you've got enough
> simultaneous long-running requests that all the available processes/threads
> are occupied at the same time?
>
> Anthony
>
> On Sunday, December 17, 2017 at 10:47:04 AM UTC-5, Lisandro wrote:
>>
>> Sorry, I forgot to mention.
>>
>> I'm using nginx + uwsgi (cheaper busyness algorithm)
>> I use redis for cache and postgresql for database.
>>
>>
>>
>> El domingo, 17 de diciembre de 2017, 12:07:10 (UTC-3), Anthony escribió:
>>>
>>> How is web2py deployed?
>>>
>>> On Sunday, December 17, 2017 at 8:41:50 AM UTC-5, Lisandro wrote:
>>>>
>>>> Hello everyone. I've read the docs [1] and also read several posts in
>>>> this forum about this problem, however I can't figure out why it's still
>>>> happening in my case. I was hoping you can help me.
>>>>
>>>> In my application I have a simple page that makes an ajax async call to
>>>> web2py in order to get some data.
>>>> The controller/function that process the call takes a few seconds to
>>>> complete (around 6-7 seconds).
>>>> During that time, if the user clics on a link in order to navigate to
>>>> another page of the application, it doesn't respond. The whole application
>>>> freezes until the ajax call completes.
>>>>
>>>> In the documentation I've read about this, and this is the expected
>>>> behaviour, because of the session file. So what I did is to put
>>>> session.forget(response) at the top of the controller/function that
>>>> process
>>>> the ajax call. But this doesn't make any difference, the application still
>>>> freezes until the ajax call is completed. I've also tried session.forget()
>>>> and session._unlock(response) with no success.
>>>>
>>>>
>>>> This is the script that makes the ajax call:
>>>>
>>>> <script type="text/javascript">
>>>> $j = jQuery.noConflict();
>>>> $j(document).ready(function() {
>>>> $j.ajax({
>>>> type: "GET",
>>>> async: true,
>>>> url: "{{=URL('default', '_dashboard')}}",
>>>> success: function(data) { $j(".dashboard").html(data) }
>>>> });
>>>> });
>>>> </script>
>>>>
>>>>
>>>>
>>>> And this is the controller/function that process the call:
>>>>
>>>> @auth.requires(auth.is_logged_in() and auth.user.plantel)
>>>> def _dashboard():
>>>> def get_info_dashboard():
>>>> from gluon.contrib.simplejsonrpc import ServerProxy
>>>> webservice = ServerProxy(CONFIG.url_webservice_central)
>>>> return webservice.get_info_dashboard({'sitio': CONFIG.cliente})
>>>>
>>>> session.forget(response)
>>>> info_dashboard = None
>>>> try:
>>>> r = cache.redis('info-dashboard', lambda: get_info_dashboard(),
>>>> time_expire=300)
>>>> if r.get('success'):
>>>> info_dashboard = r.get('info_dashboard')
>>>> except:
>>>> pass
>>>> return dict(info_dashboard=info_dashboard)
>>>>
>>>>
>>>>
>>>> What could be the issue?
>>>>
>>>> Thank you very much in advance.
>>>> Regards,
>>>> Lisandro.
>>>>
>>>>
>>>> [1] http://web2py.com/books/default/chapter/29/04/the-core#session
>>>>
>>>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.