>
>> I'm using web2py (Version 2.14.6-stable+timestamp.2016.05.09.19.18.48). 
>>
>
> How long have you been using this version?  What OS and what front end and 
> what version of Python?
>

3 years currently, python version is 2.7.5, Centos 7.5.1804, kernel 3.10.0

>  
>
>> Last week I've start getting strange errors on client side 
>>
>
> What changed on your server?
>

I've increase number of applications connected to this service and then 
Chrome (user page) start showing "waiting for available socket..." (and 
page is not loaded). Applications use mostly wget and some of them 
QNetworkAccessManager (C++ Qt component for requests handling).
 

>  
>
>> ("waiting for available socket") - I'm using Chrome. After investigation 
>> I found that DAL (PostgreSQL) object didn't close connection to database 
>> after finishing request: 
>>
>  

> I've seen issues with Chrome talking to a local instance of web2py (on 
>> W10)  using Rocket, and Chrome seems to get into a state where something 
>> cache-related is driving a lot of requests into Rocket; Usually closing 
>> Chrome clears things up (actually, closing one window of Chrome is enough, 
>> and sometimes it seems to work to close just one tab -- if I get the right 
>> one; Chrome uses multiple processes, so windows are independent, and tabs 
>> may be also).  In this environment, I'm also using 2.14.6, though I've been 
>> trialing newer versions.
>>
>
Current;y I'm not sure is this only Chrome issue, the problem is that using 
DAL withput calling explicity DAL close method leave a lot of sockets in 
wating state on server side. I was able to reduce its number to 30 (from 
~300) adding excplicity call to close method and removing DAL connection 
for some requests which didn't need database (or I use my own db 
abstraction layer with close mthod called explicity on postgreSQL 
connection). From that point of view I'm pretty user that this issue is 
kind of DAL error.
 

>
>
>> netstat -p -n -o | grep "<DATABASE_PORT_NUMBER>" 
>>
>> return a lot of entries like (~300):
>>
>> tcp        0      0 127.0.0.1:36062         127.0.0.1:5434          
>> TIME_WAIT   -                    timewait (24.30/0/0)
>>
>> DAL object is created in models/db.py and then it is passed to Auth 
>> constructor. When there is no incoming requests to application after some 
>> time (60s) every TIME_WAIT socket is closed and everything looks fine, When 
>> requests start comming then number of TIME_WAIT sockets start growing and 
>> stay about 300.
>>
>> Is there a way to call close on underlaying postgresql connection layer?
>> Is there a way to invoke some code every time processing data is finished 
>> for each request (after server proces user quest and before start sending 
>> it to browser)?
>> or maybe that was fixed in latest version
>>
>> BR
>>   KJ
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7b5fcba7-ea1f-4abe-bb5f-1242f5214557%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to