Re: Incoming/Sent traffic data

From: Israel Ben Guilherme Fonseca <israel(dot)bgf(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Incoming/Sent traffic data
Date: 2011-05-13 04:38:07
Message-ID: BANLkTikx7pVVY9O0OYwhh_PF7+cfgM5i=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> +1 too. I just asked because its common to get shot at mailists after a
little of 'off-topic'.

Well afters tons of tests, using my brand new Wireshark skills (thanks
Maciek), and I got a very strange result (even stranger than before):

I created a new database for the tests, 1 'Person' table, 2 columns (id,
name), 7000++ registers.

The traffic difference was:

Java 220861 Bytes
Python 29014 Bytes

A difference of 8x. Now, I did the same test with my proxy implementation
and got similar results. So.. that's strange. Very strange.

I think that's much probably that I'm doing something wrong, but I did and
redid all the tests many times until now, that i'm starting to accept this.

My ONLY track of explanation is this postgres log (debug5)

JAVA

simpletests DEPURAÇÃO: análise de <unnamed>: select * from "Person"
simpletests DEPURAÇÃO: StartTransactionCommand
simpletests DEPURAÇÃO: StartTransaction
simpletests DEPURAÇÃO: name: unnamed; blockState: DEFAULT; state:
INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
simpletests DEPURAÇÃO: ligação de <unnamed> para <unnamed>
simpletests LOG: executar <unnamed>: select * from "Person"
simpletests DEPURAÇÃO: CommitTransactionCommand
simpletests DEPURAÇÃO: CommitTransaction
simpletests DEPURAÇÃO: name: unnamed; blockState: STARTED; state:
INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
simpletests DEPURAÇÃO: shmem_exit(0): 6 callbacks to make
simpletests DEPURAÇÃO: proc_exit(0): 4 callbacks to make
simpletests LOG: desconexão: tempo da sessão: 0:00:12.172 usuário=postgres
banco de dados=simpletests máquina=localhost port=56401
simpletests DEPURAÇÃO: exit(0)
simpletests DEPURAÇÃO: shmem_exit(-1): 0 callbacks to make
simpletests DEPURAÇÃO: proc_exit(-1): 0 callbacks to make

PYTHON

simpletests DEPURAÇÃO: StartTransactionCommand
simpletests DEPURAÇÃO: StartTransaction
simpletests DEPURAÇÃO: name: unnamed; blockState: DEFAULT; state:
INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children:
simpletests LOG: comando: BEGIN; SET TRANSACTION ISOLATION LEVEL READ
COMMITTED
simpletests DEPURAÇÃO: ProcessUtility
simpletests DEPURAÇÃO: CommitTransactionCommand
simpletests DEPURAÇÃO: StartTransactionCommand
simpletests DEPURAÇÃO: ProcessUtility
simpletests DEPURAÇÃO: CommitTransactionCommand
simpletests DEPURAÇÃO: StartTransactionCommand
simpletests LOG: comando: select * from "Person"
simpletests DEPURAÇÃO: CommitTransactionCommand

The python log looks somewhat cleaner, and Java got this:

simpletests DEPURAÇÃO: shmem_exit(0): 6 callbacks to make
simpletests DEPURAÇÃO: proc_exit(0): 4 callbacks to make

10 extra callbacks? I dont have any idea about what is about, but maybe it
could mean something.

I hosted all the files and source code for this test-case on google code. If
you are using ubuntu it probabbly take just 10 minutes to execute everthing
and see this with your own eyes (and hopefully someone would say "your
idiot, you did THAT <code> wrong").

http://orm-native-comparative.googlecode.com/files/tests.zip

Thanks in advance,

Israel

2011/5/12 Maciek Sakrejda <msakrejda(at)truviso(dot)com>

> > +1
>
> Alright, then. I'm no Wireshark expert (or a TCP expert, for that
> matter), but I'll try to help on-list unless others complain.
>
> Israel,
>
> What I *typically* do is listen on all interfaces, and set the filter
> to pgsql (which looks only for PostgreSQL protocol messages). When
> running on a different port, you'll need to specify that explicitly or
> the pgsql filter will ignore the TCP conversation. E.g., a filter like
>
> tcp.dstport == 4444 or tcp.srcport == 4444 and pgsql
>
> should work.
>
> From there, it's a matter of getting moderately familiar with the wire
> protocol [1] and inspecting the messages Wireshark shows you in the
> packet details / packet bytes panes.
>
> [1]: http://developer.postgresql.org/pgdocs/postgres/protocol.html
> ---
> Maciek Sakrejda | System Architect | Truviso
>
> 1065 E. Hillsdale Blvd., Suite 215
> Foster City, CA 94404
> (650) 242-3500 Main
> www.truviso.com
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2011-05-13 04:52:44 Re: Incoming/Sent traffic data
Previous Message Maciek Sakrejda 2011-05-13 00:08:02 Re: Incoming/Sent traffic data