IRC logs of #tryton for Friday, 2012-10-05

chat.freenode.net #tryton log beginning Fri Oct 5 00:00:01 CEST 2012
shomondoes anyone get too many connections on postgres sometimes?18:15
shomonI have max_connections set to 100 and it still fills up sometimes in just hours18:15
shomonand this is with 10 users and not even at the same time18:15
shomonso I could raise max_connections, but I think best to find out why connections aren't being closed.. anyone have any clue?18:16
shomonI have some EOF errors in the postgres logs but not hundreds18:29
shomonwell I've got the postgres people talking about it :)18:35
rmushomon: do you have any non-standard tryton modules installed?18:40
shomonno, just the ones from tryton.org/downloads18:41
shomonthey suggest looking at tcp_keepalive18:42
shomoneither that or the app isn't closing things properly for some reason18:42
shomonI'm guessing it's either postgres or some other config18:42
rmudo you connect via tcp? postgres is running on another host?18:43
rmuyou can inspect the state of the connections with netstat18:43
shomonno, it's on the same host18:45
shomonthey also asked if there was a firewall in between.18:45
rmuso you could connect via local socket18:46
rmu(--> no tcp between tryton and postgresql, no tcp_keepalive)18:46
rmuhow many client connections are open?18:47
shomonabout 218:50
shomonat most...18:50
shomonI demoed a tryton app on monday and about 5 people connected18:51
shomonI've the same amount of errors, since that day.18:51
shomonEOF errors I mean18:51
rmuand netstat confirms there are only 5 connections open?18:51
shomonah I'll ee18:51
shomonse18:51
rmuusually, if a connection pool is running out of connections, and everything else is within sane limits, something is not returning connections properly18:52
shomonI'm not sure how to find out what is connected via netstat18:52
rmurun "netstat -nt" and look for the listening-address of the tryton-server18:53
rmus/address/port/18:53
rmui.e. 800018:53
shomontwo of them18:53
shomonoh sorry I was looking at the postgres address18:54
shomonjust the one, to port 800018:54
rmustrange18:54
shomonbut I just restarted18:55
rmuhmm. ok18:55
shomonit only does the maxing out if I leave it for a day or a few hours18:55
rmulook at netstat when it happens18:55
shomonok18:56
rmuyou could also try adding some print-statements to the connection pool, to report when a connection is requested, when a connection is returned, and how many connections are open18:56
rmuthen watch for suspicious activity and try to narrow down actions that lead to increasing open connections18:56
shomonwhat file is that?18:56
rmuhmm. don't know out of my head... mom18:57
shomonI'm looking at the files in trytond.. I'll have a grep18:57
shomonno clue...18:58
shomon:(18:58
rmuhttp://hg.tryton.org/trytond/file/7b0cd0d179db/trytond/backend/postgresql/database.py19:01
rmulook for _connpool.getconn() in line 6719:01
rmuand line 35719:02
rmuperhaps something is leaking Cursor-objects19:02
shomonoh wow, thanks! so it's an actual tryton bug19:06
shomonor could be19:06
rmudon't know19:10
rmuyou can put something like print "got connection, pool has", len(self._connpool._pool) there19:11
rmuand print "returned connection" in line 35719:11
shomonaah thanks19:11
shomonokay I'll do that now19:11
rmui think everybody else is busy with preparing the release19:12
rmuthis connection pool exhausted happens to me about every second month on some very strange setup, but i never got to debugging it properly19:12
Pilouyou could take a look at pg_stat_activity table too19:13
shomonI hope to get some db expert to have a look at it all next week, in case it's the postgres part19:13
rmui have to go know, but i will watch the chatlog19:13
rmudon't think postgres has anything to do with it19:13
shomonthanks!19:13
shomonwell we need to switch to ssl anyway19:13

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!