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

chat.freenode.net #tryton log beginning Fri Oct 5 00:00:01 CEST 2012
2012-10-05 18:15 <shomon> does anyone get too many connections on postgres sometimes?
2012-10-05 18:15 <shomon> I have max_connections set to 100 and it still fills up sometimes in just hours
2012-10-05 18:15 <shomon> and this is with 10 users and not even at the same time
2012-10-05 18:16 <shomon> so I could raise max_connections, but I think best to find out why connections aren't being closed.. anyone have any clue?
2012-10-05 18:29 <shomon> I have some EOF errors in the postgres logs but not hundreds
2012-10-05 18:35 <shomon> well I've got the postgres people talking about it :)
2012-10-05 18:40 <rmu> shomon: do you have any non-standard tryton modules installed?
2012-10-05 18:41 <shomon> no, just the ones from tryton.org/downloads
2012-10-05 18:42 <shomon> they suggest looking at tcp_keepalive
2012-10-05 18:42 <shomon> either that or the app isn't closing things properly for some reason
2012-10-05 18:42 <shomon> I'm guessing it's either postgres or some other config
2012-10-05 18:43 <rmu> do you connect via tcp? postgres is running on another host?
2012-10-05 18:43 <rmu> you can inspect the state of the connections with netstat
2012-10-05 18:45 <shomon> no, it's on the same host
2012-10-05 18:45 <shomon> they also asked if there was a firewall in between.
2012-10-05 18:46 <rmu> so you could connect via local socket
2012-10-05 18:46 <rmu> (--> no tcp between tryton and postgresql, no tcp_keepalive)
2012-10-05 18:47 <rmu> how many client connections are open?
2012-10-05 18:50 <shomon> about 2
2012-10-05 18:50 <shomon> at most...
2012-10-05 18:51 <shomon> I demoed a tryton app on monday and about 5 people connected
2012-10-05 18:51 <shomon> I've the same amount of errors, since that day.
2012-10-05 18:51 <shomon> EOF errors I mean
2012-10-05 18:51 <rmu> and netstat confirms there are only 5 connections open?
2012-10-05 18:51 <shomon> ah I'll ee
2012-10-05 18:51 <shomon> se
2012-10-05 18:52 <rmu> usually, if a connection pool is running out of connections, and everything else is within sane limits, something is not returning connections properly
2012-10-05 18:52 <shomon> I'm not sure how to find out what is connected via netstat
2012-10-05 18:53 <rmu> run "netstat -nt" and look for the listening-address of the tryton-server
2012-10-05 18:53 <rmu> s/address/port/
2012-10-05 18:53 <rmu> i.e. 8000
2012-10-05 18:53 <shomon> two of them
2012-10-05 18:54 <shomon> oh sorry I was looking at the postgres address
2012-10-05 18:54 <shomon> just the one, to port 8000
2012-10-05 18:54 <rmu> strange
2012-10-05 18:55 <shomon> but I just restarted
2012-10-05 18:55 <rmu> hmm. ok
2012-10-05 18:55 <shomon> it only does the maxing out if I leave it for a day or a few hours
2012-10-05 18:55 <rmu> look at netstat when it happens
2012-10-05 18:56 <shomon> ok
2012-10-05 18:56 <rmu> you 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 open
2012-10-05 18:56 <rmu> then watch for suspicious activity and try to narrow down actions that lead to increasing open connections
2012-10-05 18:56 <shomon> what file is that?
2012-10-05 18:57 <rmu> hmm. don't know out of my head... mom
2012-10-05 18:57 <shomon> I'm looking at the files in trytond.. I'll have a grep
2012-10-05 18:58 <shomon> no clue...
2012-10-05 18:58 <shomon> :(
2012-10-05 19:01 <rmu> http://hg.tryton.org/trytond/file/7b0cd0d179db/trytond/backend/postgresql/database.py
2012-10-05 19:01 <rmu> look for _connpool.getconn() in line 67
2012-10-05 19:02 <rmu> and line 357
2012-10-05 19:02 <rmu> perhaps something is leaking Cursor-objects
2012-10-05 19:06 <shomon> oh wow, thanks! so it's an actual tryton bug
2012-10-05 19:06 <shomon> or could be
2012-10-05 19:10 <rmu> don't know
2012-10-05 19:11 <rmu> you can put something like print "got connection, pool has", len(self._connpool._pool) there
2012-10-05 19:11 <rmu> and print "returned connection" in line 357
2012-10-05 19:11 <shomon> aah thanks
2012-10-05 19:11 <shomon> okay I'll do that now
2012-10-05 19:12 <rmu> i think everybody else is busy with preparing the release
2012-10-05 19:12 <rmu> this connection pool exhausted happens to me about every second month on some very strange setup, but i never got to debugging it properly
2012-10-05 19:13 <Pilou> you could take a look at pg_stat_activity table too
2012-10-05 19:13 <shomon> I hope to get some db expert to have a look at it all next week, in case it's the postgres part
2012-10-05 19:13 <rmu> i have to go know, but i will watch the chatlog
2012-10-05 19:13 <rmu> don't think postgres has anything to do with it
2012-10-05 19:13 <shomon> thanks!
2012-10-05 19:13 <shomon> well we need to switch to ssl anyway

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!