WebFaction
Community site: login faq

This morning I'm getting a lot of "OperationalError: (OperationalError) SSL connection has been closed unexpectedly" errors in my CherryPy webapp when it tries to query the PostgreSQL database.

The webapp was working for months without any issues. Any ideas on what might be the problem? Thanks!

This question is marked "community wiki".

asked 19 Jun '12, 02:22

bojanb's gravatar image

bojanb
112
accept rate: 0%


It's hard to tell what was wrong without looking at some logs. Can you open a ticket, and provide as much information as you have on this issue? The approximate time this happened would be particularly helpful. Thanks!

permanent link

answered 19 Jun '12, 09:01

todork's gravatar image

todork
1.2k4
accept rate: 34%

I've had some problems with leaking connections in my application, so as a temporary fix I increased the connection pool size to 500 connections. It seems this was the problem.

Returning the pool size to 20 seems to have eradicated the OperationalError errors. However, now I'm back to running out of connections pretty quickly, but that's another (and more tractable) problem.

permanent link
This answer is marked "community wiki".

answered 11 Jul '12, 06:38

bojanb's gravatar image

bojanb
112
accept rate: 0%

This is a huge problem for me right now. I've had this problem on a server. I was told to migrate to a new server to try and correct the problem without success.

I'll try with a bigger connection pool and see if it works.

EDIT: This might be a problem with SQLAlchemy (see ticket 2712 and ticket 2691). Check out the version you are using. Those fixes were introduced recently in 0.8.2 . I'll update my applications to this new version and see.

EDIT2: After some more investigation, I've decided to use the Pessimistic Disconnect Handling from SQLAlchemy. It basically does a ping (SELECT 1) to the database before using a connection from the pool. If the ping fails for any reason, it recycle the whole connection pool.

permanent link

answered 14 Oct '13, 20:25

delizseemack's gravatar image

delizseemack
12
accept rate: 0%

edited 11 Nov '13, 13:40

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×106
×86
×32
×4

question asked: 19 Jun '12, 02:22

question was seen: 4,450 times

last updated: 11 Nov '13, 13:40

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM