Hi all,

I am frequently running into this exception (the full call stack is at
the end of this post):

"psycopg2.OperationalError: FATAL:  sorry, too many clients already"

This obviously wreaks havoc on the functionality of my server. I am
using web2py version 1.74.5 with PostgresSQL 8.4.

Currently, I have three clients, which programatically connect to the
web2py server a few times a minute and upload/download data. I am
wondering if I need to explicitly close their database connection
somewhere in the web2py code?

I know that I can open pgAdmin III and execute the following SQL
command to get information about active connections:

select * from pg_stat_activity;

However, the Postgres database won't accept my pgAdmin connection
because it has too many client connections already.

I also know that I can up the max_connections number in the
postgresql.conf file; however, I don't think that this is the root of
the problem as it is currently set to 100 and this should be more than
enough connections for my current setup.

Full call stack:
psycopg2.OperationalError: FATAL:  sorry, too many clients already
File "C:\Python25\Lib\threading.py", line 462, in __bootstrap
  self.__bootstrap_inner()
File "C:\Python25\Lib\threading.py", line 486, in __bootstrap_inner
  self.run()
File "C:\web2py\gluon\wsgiserver.py", line 1376, in run
  conn.communicate()
File "C:\web2py\gluon\wsgiserver.py", line 1260, in communicate
  req.respond()
File "C:\web2py\gluon\wsgiserver.py", line 672, in respond
  self._respond()
File "C:\web2py\gluon\wsgiserver.py", line 678, in _respond
  response = self.wsgi_app(env, self.start_response)
File "C:\web2py\gluon\main.py", line 625, in app_with_logging
  ret[0] = wsgiapp(environ, responder2)
File "C:\web2py\gluon\contrib\wsgihooks.py", line 48, in __call__
  result = self.__application(environ, start_response)
File "C:\web2py\gluon\main.py", line 478, in wsgibase
  serve_controller(request, response, session)
File "C:\web2py\gluon\main.py", line 191, in serve_controller
  run_models_in(environment)
File "C:\web2py\gluon\compileapp.py", line 370, in run_models_in
  restricted(code, environment, layer)
File "C:\web2py\gluon\restricted.py", line 180, in restricted
  sys.excepthook(etype, evalue, tb)
File "C:\web2py\applications\hydroserver\models\db.py", line 18, in
<module>
  db=SQLDB('postgres://hidden_connection_string')
File "C:\web2py\gluon\sql.py", line 950, in __init__
  self._pool_connection(lambda : psycopg2.connect(msg))
File "C:\web2py\gluon\sql.py", line 829, in _pool_connection
  self._connection = f()
File "C:\web2py\gluon\sql.py", line 950, in <lambda>
  self._pool_connection(lambda : psycopg2.connect(msg))

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to