简体   繁体   English

在Pentaho中创建仪表板时在postgres中创建的“连接过多”

[英]'Too many connections' created in postgres when creating a dashboard in Pentaho

I was creating a Dashboard in Pentaho PUC which uses a postgres connection as the data source. 我正在Pentaho PUC中创建一个仪表板,该仪表板使用postgres连接作为数据源。 Most of the time this causes the postgres to say 在大多数情况下,这会导致postgres说

Too many clients already in Postgres' Postgres中已经有太多客户了


SHOW max_connections; Query shows maximum connections of 200 查询显示最大连接数为200

I used this query select * from pg_stat_activity; 我用这个查询select * from pg_stat_activity; . From that 90% of connections are from the Pentaho server to the database I use as the datasource in my new dashboard. 其中90%的连接是从Pentaho服务器到数据库的连接,我将其用作新仪表板中的数据源。 waiting is f and state is idle in most of the connections. 在大多数连接中, f waitingstateidle This looks like Pentaho is creating too many connections. 看来Pentaho创建了太多的连接。 How can I limit or Control it? 如何限制或控制它? I have already tried increasing connection limit from default 100 to 200 from postgres side but still the issue is there. 我已经尝试从postgres方面将连接限制从默认的100增加到200,但是仍然存在问题。

From the comments thread on the original question it seems you're using SQL over JDBC connections on your dashboard. 从原始问题的注释线程看来,您正在仪表板上使用基于JDBC连接的SQL。 This will create a different database connection for each query that needs to run and if they are somewhat slow you may reach the limit on the number of concurrent connections. 这将为每个需要运行的查询创建一个不同的数据库连接,如果它们运行缓慢,则可能会达到并发连接数限制。

Instead, you should set up a JNDI: on your datasource management window add a new connection and set up the correct credentials. 相反,您应该设置一个JNDI:在数据源管理窗口上添加一个新连接并设置正确的凭据。 Under advanced options set up a connection pool. 在高级选项下,设置连接池。 Give it a meaningful name. 给它起一个有意义的名字。 From that point on, you should refer to that name on your dashboard queries and use SQL over JNDI instead of SQL over JDBC. 从那时起,您应该在仪表板查询中引用该名称,并使用基于JNDI的SQL而不是基于JDBC的SQL。 This way each SQL query will get a connection from the connection pool and the DB only sees 1 connection at each time, despite running multiple queries. 这样,每个SQL查询都会从连接池中获得一个连接,尽管运行多个查询,但DB每次只能看到1个连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 node-postgres:连接过多时ECONNREFUSED - node-postgres : ECONNREFUSED when connections are too many Hangfire:在 postgres 上打开的连接太多 - Hangfire: Too many connections opened on postgres golang postgres连接过多错误 - golang postgres too many connections error 尝试连接到任何 Postgres 13 实例时出现“错误:数据库 'postgres' 的连接过多” - “error: too many connections for database 'postgres'” when trying to connect to any Postgres 13 instance Azure Function创建到PostgreSQL的连接过多 - Azure Function creating too many connections to PostgreSQL 在postgres中创建的WAL存档文件过多 - Too many WAL archive file created in postgres Heroku Postgres:连接太多了。我如何杀死这些连接? - Heroku Postgres: Too many connections. How do I kill these connections? 如何在 Vercel 无服务器函数中处理 Postgres 连接池? (“角色连接太多”) - How to handle Postgres connection pooling in Vercel serverless functions? (“too many connections for role”) postgres db显示连接过多。原因是什么。 如何在jmeter工具中检查连接 - postgres db shows too many connections .what is the reason. how to check connection in jmeter tool JAVA + Postgres限制连接,如何关闭! 致命:抱歉,已经有太多客户 - JAVA + Postgres Limit connections , how to close it ! FATAL: sorry, too many clients already
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM