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

Error: Postgis Plugin: bad connection #16

Closed
strk opened this issue Apr 18, 2012 · 14 comments
Closed

Error: Postgis Plugin: bad connection #16

strk opened this issue Apr 18, 2012 · 14 comments

Comments

@strk
Copy link
Contributor

strk commented Apr 18, 2012

I was seeing complete tiles missing from the display of a map and when looking at the windshaft log file I found a bunch of:

[TILE RENDER ERROR]
Error: Postgis Plugin: bad connection

For other tiles it works fine so dunno what to look at.
Maybe a limit on number of client connections ?

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

Only the queries for the working tiles show up in the postgresql log. No trace in the postgresql log about any connection error.

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

The error message comes from mapnik itself. Debugging it now.

@tokumine
Copy link
Contributor

I use windshaft with pg_bouncer (I think this is in the readme), but I
get the same error also as you if I run it direct to postgres.

On Wed, Apr 18, 2012 at 11:21 AM, strk
reply@reply.github.com
wrote:

I was seeing complete tiles missing from the display of a map and when looking at the windshaft log file I found a bunch of:

   [TILE RENDER ERROR]
   Error: Postgis Plugin: bad connection

For other tiles it works fine so dunno what to look at.
Maybe a limit on number of client connections ?


Reply to this email directly or view it on GitHub:
#16

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

On Wed, Apr 18, 2012 at 03:37:23AM -0700, tokumine wrote:

I use windshaft with pg_bouncer (I think this is in the readme),

No trace of pg_bouncer in the Windshaft-cartodb README file

but I get the same error also as you if I run it direct to postgres.

Don't you think it's a bug ?

--strk;

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

My database has max_connection 100.
In lib/cartodb/connection_pool.rb there's a MAX_SIZE of 300.

Should that value be configured in the environment config instead ?

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

Alright I succeeded in fixing this. It was the max_size parameter in the XML file. Setting it to 0 keeps growing it until it ends out of connections.

So I think there are a couple of issues here:

  1. Not limiting the maximum number of connections
  2. Leaking connections ?

@tokumine
Copy link
Contributor

Set map connections to 10 in the environment settings?

On 18 Apr 2012, at 15:09, strkreply@reply.github.com wrote:

Alright I succeeded in fixing this. It was the max_size parameter in the XML file. Setting it to 0 keeps growing it until it ends out of connections.

So I think there are a couple of issues here:

  1. Not limiting the maximum number of connections
  2. Leaking connections ?

Reply to this email directly or view it on GitHub:
#16 (comment)

@tokumine
Copy link
Contributor

Note, after setting connections to 0, flush the XML cache....

Simon

On 18 Apr 2012, at 15:09, strkreply@reply.github.com wrote:

Alright I succeeded in fixing this. It was the max_size parameter in the XML file. Setting it to 0 keeps growing it until it ends out of connections.

So I think there are a couple of issues here:

  1. Not limiting the maximum number of connections
  2. Leaking connections ?

Reply to this email directly or view it on GitHub:
#16 (comment)

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

So I tried to reset redis cache and see the effects. I got no leakage, but a stable 4 connections, no matter max_size=0.

I could reproduce the problem by killing windshaft node instance and restarting it.
On restart, and after a page reload, windshaft complains:

[TILE RENDER ERROR]
Error: Postgis Plugin: bad connection (no more connections in a pool of 0 unused / 1 used connections)

The debugging information in parens I added the code for in my version of mapnik.
Postgresql shows a single connection only after this kill/restart.

There must be something making windshaft choke on kill...

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

I'm still here, and can't fix it anymore now. redis keys are all cleared except "rails:cartodb_dev_user_2_db:clu_a_wi043"

@tokumine
Copy link
Contributor

Sorry strk, at the airport now. Will check in when I land

On 18 Apr 2012, at 16:02, strkreply@reply.github.com wrote:

I'm still here, and can't fix it anymore now. redis keys are all cleared except "rails:cartodb_dev_user_2_db:clu_a_wi043"


Reply to this email directly or view it on GitHub:
#16 (comment)

@strk
Copy link
Contributor Author

strk commented Apr 18, 2012

Setting max_size:32 in windshaft's config/environment/development.js and flushing the XML in redis makes it work again. This time the pool has 4 records again. Sounds like max_size:0 isn't working as expected.

@strk
Copy link
Contributor Author

strk commented May 7, 2012

max_size=0 commented out, matching production (and fixing this issue for me), in 0a305a9

@strk strk closed this as completed May 7, 2012
@tokumine
Copy link
Contributor

tokumine commented May 7, 2012

tks

On Mon, May 7, 2012 at 5:52 PM, strk <
reply@reply.github.com

wrote:

max_size=0 commented out, matching production (and fixing this issue for
me), in 0a305a9


Reply to this email directly or view it on GitHub:

#16 (comment)

strk pushed a commit that referenced this issue Feb 27, 2014
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