Skip site navigation (1) Skip section navigation (2)

Re: Get bytes sent to client

From: Alexander Pyhalov <alp(at)rsu(dot)ru>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: dmp <danap(at)ttc-cmc(dot)net>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Get bytes sent to client
Date: 2009-12-19 09:47:59
Message-ID: 4B2CA14F.6030305@rsu.ru (view raw or flat)
Thread:
Lists: pgsql-jdbc
Good day..
I've just made new patch - extended BufferedOutputStream and 
VisibleBufferedInputStream, as you suggested. It works, and results are 
comparable with tcpdump data (for received traffic). For sent traffic 
they are incorrect, because I can't account all ACK, but only PGSQL 
traffic.
It's suprising, that received traffic is more then tcpdump shows ( 2%, 
butt more). I thought it would be a bit smaller then actual data.
However, this data gives good approximation (2% for 100MB traffic is not 
a lot).

Craig Ringer wrote:
> On 18/12/2009 2:34 PM, Alexander Pyhalov wrote:
>>
>> I've made patch for Postgres JDBC driver. Now driver accounts bytes
>> sent/received from client ing PGStream.
> 
> Can't you extend or wrap the pg_input / pg_output streams to do the 
> accounting in their read(...) / write(...) method instead? The way 
> you've done it is rather fragile and is very prone to bitrot as other 
> parts of the driver are changed.
> 
> -- 
> Craig Ringer


-- 
С уважением,
Александр Пыхалов,
системный администратор ЮГИНФО ЮФУ.

Attachment: patch.pgsql.2
Description: text/plain (8.6 KB)

In response to

Responses

pgsql-jdbc by date

Next:From: Maciek SakrejdaDate: 2009-12-21 01:24:39
Subject: Re: Cheapest way to poll for notifications? & Driver improvement question re SSL and notify
Previous:From: Craig RingerDate: 2009-12-19 07:24:53
Subject: Re: Cheapest way to poll for notifications?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group