2 processes running under postgres user consuming very high cpu - postgresql

I have a ubuntu server with postgres installed. It is showing me 2 processes running under postgres user. One of them is a cron command and the other tsm.
I have absolutely no idea how they are being executed. I have been trying to google it for hours and I cannot seem to find any references for them.
Any idea where to start looking and how to switch them off ?

Related

Postgres and Replication

I am not too familiar with Bucardo and Postgres , so I was hoping to get some feedback / how to from this question.
We have 3 computers running in parallel in various parts of the building. When one updates something the other shows the data etc thanks to bucardo syncs running between the computers.
However here is the requirement. At anytime one computer can be brought offline and reimaged. Now when this computer comes back on line, the operator should be able to hit replicate and get the data from the master computer.
What is the best way to accomplish this ?
My thought was to run a pg_dump on the master computer and run pg_restore on the reimaged computer.
or do you think setting bucardo onetimecopy=2 is the best course of action.

user postgres launches process that takes all CPUs 100% usage

User postgres is running a process that take all CPUs at 100% usage in a centos machine, the postgresql service is not running so it cannot be a query.
When I try to stop the process it restarts itself. Then name of the process is somewhat strange.
Congratulations!
By exposing a database with a weak superuser password to the internet you invited somebody to break in and use your CPU for their own purposes, probably mining crypto-currencies.
Take the machine from the internet, wipe it clean and re-install the operating system.
I had the same issue on my VPS. I considered to reinstall OS or clone VPS, but have alot of issues on that solution. So, i choose another way:
I did:
backup all data with "pg_dumpall"
backup pqsql configuration(pg_hba.conf,postgresql.conf,...)
Uninstall "everything" of pgsql
reinstall pgsql
restore pgsql data
Done

Connecting to Windows Postgresql takes 10 seconds

I installed Postgresql 9.6 on Windows (x64), using the default installer.
I did this on 2 almost identical machines. On the first machine making a connection to localhost (for example by using psql) is instant, while on the other machine it takes more than 10 seconds.
I even copied the entire directory of the first machine, to make sure there is no difference, but the problem persists. The services are the same, and already running when Windows starts.
What on earth could cause this delay on that one machine?
Any way to identify what's going on?

Postgres Restore taking ages (days)

I've been working on a backup / restore for a Postgres server for quite a while now. It's an Azure Windows Virtual Machine (Windows server 2012).
The database isn't that big (near 5Gb), but the restore takes (literally) days. I've tried (several) times with different settings to restore the database, but all of the times it took days to "finish" (it didn't finish - I killed the process because I didn't see anything happening, that's why I'm running the job verbose this time).
I've now been running the job (verbose one) for 5 days straight and still it isn't finished. It's inserting rows (or at least displaying the rows), but it's still running.
Currently I'm using this command:
pg_restore -Fc -v --jobs=2 --host=localhost [filename]
Jobs is set at 2 because it's a dual core server. Like I said: different settings still very very slow.
What is wrong - should I be "tuning" the database before the restore or what?
This is a test-server setup. When we're doing with the test the current data need to be restored (again) to the new production server: we can't afford to wait days on end before the production environment comes online.
It's not pushing errors into the logs or something - it just keeps running and running and running...
So what am I doing wrong?

why my postgres job stop running?

I create a job to clean the database every day at 01:00.
According to statistic run OK from 3 months.
But today i realize the database size was very big so i check the jobs and hasn't run for one month.
Properties say last run was '10/27/2014' and statistics confirm run successful.
Also say next run will be '10/28/2014' but looks like never run and stay frozen since then.
(I'm using dd/mm/yyyy format)
So why stop running?
There is a way to restart the job or should i go and delete and recreate the job?
How can i know a job didn't run?
I guess i can write a code if job isn't successful but what about if never execute?
Windows Server 2008
PostgreSQL 9.3.2, compiled by Visual C++ build 1600, 64-bit
The problem was the pgAgent service wasn't running.
When I Restart the Postgres service:
Postgres service stop
pgAgent stop because is a dependent service
Postgres service start
but pgAgent didn't
Here you can see pgAgent didn't start.