jfcoz / postgresqltuner

Simple script to analyse your PostgreSQL database configuration, and give tuning advice
https://postgresqltuner.pl
GNU General Public License v3.0
2.6k stars 189 forks source link

Does this tool support a postgresql running in a docker container? #53

Open jlegido opened 5 years ago

jlegido commented 5 years ago

I got below error running the docker container in a host which is running the postgresql server, but as a docker container:

ssh: connect to host dbhost port 22: Connection refused
Use of uninitialized value in division (/) at /usr/bin/postgresqltuner.pl line 624.
Argument "" isn't numeric in division (/) at /usr/bin/postgresqltuner.pl line 624.
Illegal division by zero at /usr/bin/postgresqltuner.pl line 624.

I assume that this script is not intended to work in such this scenario.

Can somebody please confirm?

Thanks.

szymonk92 commented 4 years ago

I am facing similar issue running docker-compose

postgresqltuner.pl version 1.0.1
DBI connect('dbname=template1;host=/var/run/postgresql;port=5432;','postgres',...) failed: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? at /usr/bin/postgresqltuner.pl line 246.
[OK]      I can invoke executables
Connecting to /var/run/postgresql:5432 database template1 as user 'postgres'...
klimber commented 1 year ago

@jlegido Your issue seems related to the script trying to create an SSH connection to the container, have you tried running with the --skip-ssh option?