Thread: pgbench v14.2 and hostname

pgbench v14.2 and hostname

From
Tomasz Ziss
Date:
Hi,

I'm not sure if I'm doing correctly, but I cannot specify hostname in
pgbench (v14.)
[postgres@postgres14p ~]$ pgbench -h localhost -f
/var/lib/pgsql/scripts/script.sql -c 10 -T 5 -U postgres postg
res 2>/dev/null
[postgres@postgres14p ~]$
[postgres@postgres14p ~]$ echo $?
1

Without hostname (going through socket) it works correctly:
[postgres@postgres14p ~]$ pgbench -f /var/lib/pgsql/scripts/script.sql
-c 10 -T 5 -U postgres postgres 2>/dev/null
pgbench (14.2)
transaction type: /var/lib/pgsql/scripts/script.sql
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 5 s
number of transactions actually processed: 184018
latency average = 0.270 ms
initial connection time = 26.990 ms
tps = 36984.453980 (without initial connection time)

My /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.103 postgres14s postgres14s

Br,
Tomasz



Re: pgbench v14.2 and hostname

From
Laurenz Albe
Date:
On Mon, 2022-03-07 at 11:46 +0100, Tomasz Ziss wrote:
> I'm not sure if I'm doing correctly, but I cannot specify hostname in
> pgbench (v14.)
> [postgres@postgres14p ~]$ pgbench -h localhost -f
> /var/lib/pgsql/scripts/script.sql -c 10 -T 5 -U postgres postg
> res 2>/dev/null
> [postgres@postgres14p ~]$
> [postgres@postgres14p ~]$ echo $?
> 1

I suggest that you look at the error messages rather than sending
them to /dev/null.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




Re: pgbench v14.2 and hostname

From
Tomasz Ziss
Date:
Thx. Problem was with wrong ph_hba.conf entry.

[postgres@postgres14p ~]$ pgbench -h localhost -f
/var/lib/pgsql/scripts/script.sql -c 10 -T 5 -U postgres postgres
pgbench (14.2)
starting vacuum...end.
transaction type: /var/lib/pgsql/scripts/script.sql
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 5 s
number of transactions actually processed: 111282
latency average = 0.437 ms
initial connection time = 138.164 ms
tps = 22879.721402 (without initial connection time)

On Mon, Mar 7, 2022 at 11:49 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> On Mon, 2022-03-07 at 11:46 +0100, Tomasz Ziss wrote:
> > I'm not sure if I'm doing correctly, but I cannot specify hostname in
> > pgbench (v14.)
> > [postgres@postgres14p ~]$ pgbench -h localhost -f
> > /var/lib/pgsql/scripts/script.sql -c 10 -T 5 -U postgres postg
> > res 2>/dev/null
> > [postgres@postgres14p ~]$
> > [postgres@postgres14p ~]$ echo $?
> > 1
>
> I suggest that you look at the error messages rather than sending
> them to /dev/null.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>



Re: pgbench v14.2 and hostname

From
Amit jain
Date:
pg_bench support -h option so you should be able to execute query on remote host, it worked for me earlier.  error message will help debug. 


On Mon, Mar 7, 2022 at 4:19 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Mon, 2022-03-07 at 11:46 +0100, Tomasz Ziss wrote:
> I'm not sure if I'm doing correctly, but I cannot specify hostname in
> pgbench (v14.)
> [postgres@postgres14p ~]$ pgbench -h localhost -f
> /var/lib/pgsql/scripts/script.sql -c 10 -T 5 -U postgres postg
> res 2>/dev/null
> [postgres@postgres14p ~]$
> [postgres@postgres14p ~]$ echo $?
> 1

I suggest that you look at the error messages rather than sending
them to /dev/null.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com