Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection pool is exhausted #230

Open
alanhdu opened this issue Apr 28, 2018 · 1 comment
Open

Connection pool is exhausted #230

alanhdu opened this issue Apr 28, 2018 · 1 comment

Comments

@alanhdu
Copy link
Contributor

alanhdu commented Apr 28, 2018

Presumably due to how expensive the predict page is.

Traceback (most recent call last):
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1610, in full_dispatch_request
    rv = self.preprocess_request()
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/flask/app.py", line 1831, in preprocess_request
    rv = func()
  File "/density/density/__init__.py", line 40, in get_connections
    g.pg_conn = pg_pool.getconn()
  File "/root/.local/share/virtualenvs/density-7DeN0QYC/lib/python3.6/site-packages/psycopg2/pool.py", line 91, in _getconn
    raise PoolError("connection pool exhausted")
psycopg2.pool.PoolError: connection pool exhausted
@ignacio-ramirez-piriz
Copy link
Collaborator

Seems to be working now. The problem seemed to be at librarytimes.py. I added caching (for three hour periods) for predictions so it shouldn't be that expensive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants