Heroku postgres, unwanted "puma: cluster worker" connections to my database - heroku

I have several heroku sites with postgres database.
The site is based on node.js - nothing else at the server side.
As I look in my PgAdmin open sessions I see 4 connections called puma: cluster worker #: 17 [app] (# is number)
They are idle but are open for many hours and the number of connections is growing. taking up more and more of my available 20 connections in the hobby-dev plan.
The last sql they run is:
SELECT "oid", "typname" FROM "pg_type" WHERE (("typtype" = 'b') AND ("typname" IN ('hstore')))
Here's a screen shot:
What are they and why do I need them?
EDIT:
As time goes by it's getting worst:

Related

Is it normal to see connections in heroku postgres that dont belong to your app?

I'm debugging issues with my postgres running out of connections to give so I decided to look under the hood for how many open connections currently exist, using:
SELECT sum(numbackends) FROM pg_stat_database;
I see 123 🤔. Now that cant be right. Lets look at who's connecting to the DB:
SELECT application_name FROM pg_stat_activity order by application_name;
/app/bin/rails
/app/vendor/bundle/ruby/2.6.0/bin/puma
/app/vendor/bundle/ruby/3.0.0/bin/puma
/app/vendor/bundle/ruby/3.0.0/bin/puma
/app/vendor/bundle/ruby/3.0.0/bin/puma
/app/vendor/bundle/ruby/3.0.0/bin/rackup
bin/rails
bin/rails
bin/rails
bin/rails
DBeaver 22.1.4 - Main <d7i081pnvh4lhn>
DBeaver 22.1.4 - Metadata <d7i081pnvh4lhn>
GoodJob::Notifier
hc.dbmon
hc.dbmon
hc.dbmon
hc.dbmon
hc.dbmon
pgAdmin 4 - CONN:360832
pgAdmin 4 - DB:d912h2n04vgugu
PostgreSQL JDBC Driver
PostgreSQL JDBC Driver
PostgreSQL JDBC Driver
PostgreSQL JDBC Driver
... (40-50 rows of the same)
psql interactive
puma: cluster worker 0: 4 [app]
sidekiq 6.0.1 app [0 of 5 busy]
sidekiq 6.0.1 app [0 of 5 busy]
So that's weird, I just have a rails app using GoodJob. I dont use sidekiq, no business with JDBC or using DBeaver. It seems like I'm seeing the postgres connections from other users/apps that are sharing the postgres server instance.
Is this leaky abstraction normal? I would have expected a pretty air-tight lockdown of this information being shared between different app instances. There's no query information leaking but still.
Whats a straightforward way to my app's connections? What I'm currently doing is filtering out everything where the query is not 'Insufficient Privilege'.
pg_stat_activity shows data for the server:
The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process.
Note that this information is not restricted to any particular database. With Heroku Postgres, you don't get a dedicated server. Other users' databases will be running on the same server, so the data you see there includes those users' connections.

Oracle Keep Alive Test SQL_NET.EXPIRE_TIME not working

I have been trying to successfully configure oracle database 11g with dead connection detection keep alive settings without changing any tcp settings. I went into $ORACLE_HOME/network/admin/sqlnet.ora and set the oracle keep alive to 10 minutes (SQL_NET.EXPIRE_TIME = 10). I also went into tnsnames.ora file and added the ENABLE=BROKEN parameter to the net_service_name. In one terminal I find the Oracle session process ID and then open a second terminal where I use the Linux trace tool to verify there is a write after 10 minutes. Unfortunately there is no write after 10 minutes. The only time there is a write is when the original oracle session being traced is disconnected or there is activity being performed in this session. I am trying to figure out how to resolve the issue of not seeing a write every 10 minutes to verify the server process sent an empty packet to the client.

ORA-02049: timeout: distributed transaction waiting for lock

1- this error is in was logs. Nothing in alert log from server side (11.2.0.4)
2- the error talks about distributed transactions. There's no such thing. There's no dblink from or to the database.
I searched the web and oracle support the whole day. All talk about distributed transactions using dblink and increasing DISTRIBUTED_LOCK_TIMEOUT parameter set to default value 1 mn.
but there's no db link or distant access. There's only 2 websphere nodes for load balancing.
3 - there's no blocking issues. The problem happened when no activity on database.
It happens when booth WAS nodes are not synchronized
Ripple start solves the problem

Heroku: How Can I Stop My Postgres Databases from Disappearing after a few minutes?

Yesterday I uploaded a Rails 5 application with multiple databases to Heroku. I have a hobby-dev postgres add-on. This morning I successfully imported my 7 Postgres databases using pg_dump backups created according to the Heroku documentation.
PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump
heroku pg:backups:restore 'https://s3.amazonaws.com/me/items/3H0q/mydb.dump' HEROKU_POSTGRESQL_COLOR_URL
Several times I have imported these databases because after a few minutes they disappear. I ran my Heroku app and the first database was successfully accessed but by the time I tried to access the second one I received a 'relation "xxxx" does not exist'. When I went back to my datastore the databases were gone. When I tried to run my app a second time I got a 'relation "xxxx" does not exist' on the first table that I successfully accessed the previous time I ran my app.
I'm not seeing any errors when I look at the data-store for the database. They just disappear. I checked to see if there was a limit to the number of databases I could have with the hobby-dev but did not see any. The row count is under 10,000. Each time I have imported my pg_dump files I get a warning email about the number of rows.
UPDATE 2/17/2017 10:42 AM central: The only thing I have found so far are some posts stating that the Heroku filesystem is ephemeral, and does not persist between dyno restarts. If this is my problem:
How do I know when dynos restart if I don't restart it? I had not restarted my app when my databases disappeared.
How can I permanently store my databases using the Postgres add-on or do I have to store my databases elsewhere? Surely the add-on has a way to permanently store databases.
I assume you use Heroku PostgreSQL offering (instead of trying to set it up on your own). If that's the case the ephemeral nature of dyno file systems shouldn't be your concern.
I recommend that you first create the seven (empty) databases and see if they disappear or not. You can create a single database with
heroku addons:create heroku-postgresql:hobby-dev
After each call run heroku pg:wait to wait until the database has been provisioned. If the databases don't disappear try restoring your backups then.

Postgres Process Suspended Windows 10

Good day I have a business automation system that uses the Postgres database.
I have a problem that is very common in my clients. I am using the 9.5 version of Postgres and "nothing" one postgres process is suspended and can no longer close it or return to normal, there the database lock, and only starts restarting the computer, a customer has times what happens to the bank continue working more does not accept a new connection. The seviço postgres is with the status Running, but not for no more restarts.
-already tried to change the Secondary Logon service to automatic and did not work.

Resources