question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

digdag server made too many Postgres connections on my machine

See original GitHub issue

https://github.com/treasure-data/digdag/pull/280/commits/780d61780ae5658547b87b44222a870942ebc715#diff-d11545055f57d9e418a11dd1e06f680d

        int maximumPoolSize = config.get("database.maximumPoolSize", int.class,
                Runtime.getRuntime().availableProcessors() * 32); // HikariCP default: 10
example

My machine has 32 cores and digdag tried to make 1024 connections. It exceeded to my Postgres’s max_connections. And digdag occupied every postgres connection on the server. Other processes couldn’t make new connect/reconnect. It had broken other jobs on server.

I had written database.maximumPoolSize = 10 in postgresql.properties and it has stopped.

To prevent this tragedy on others

There are various ways:

  1. Limit maximumPoolSize to some percentage of max connections parameter. (by getting SHOW max_connections)
  2. Warning when it exceeds.
  3. More document about maximumPoolSize and urge to set maximumPoolSize when user creating postgres.properties file (or encourage to setup pgpool).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
frsyukicommented, Oct 20, 2017

use small connection pool size by setting database.maximumPoolSize (integer, default: available CPU cores * 32)

1reaction
komamitsucommented, Mar 28, 2017

@kitsuyui We released https://github.com/treasure-data/digdag/pull/515 instead of #466 as 0.9.8. It would be great if you try it

Read more comments on GitHub >

github_iconTop Results From Across the Web

psql: FATAL: too many connections for role - Stack Overflow
From inside any DB of the cluster: Catch 22: you need to be connected to a database first. Maybe you can connect as...
Read more >
“Sorry, too many clients already” - How to Use PgPool to Solve ...
EDB explains how to handle the problem when maximum concurrent connections limit exceeds for PostgreSQL and step-by-step using Pgpool to ...
Read more >
'FATAL too many connections' error when using PostgreSQL ...
Symptoms. A JIRA application PostgreSQL database may starve for connections through the authenticated applications PostgreSQL user, causing it ...
Read more >
Hiroyuki Sato on Twitter: "@Civitaspo なるほど、デッドロックを ...
digdag server made too many Postgres connections on my machine · Issue #478 · treasure-data/digdag. 780d617#diff-d11545055f57d9e418a11dd1e06f680d int ...
Read more >
Treasure Data FAQs - Comparably
You must be an account owner or administrator to change the role of an existing user. Open TD Console. Read More.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found