pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ODBC Driver performance comparison
4+ messages / 3 participants
[nested] [flat]

* ODBC Driver performance comparison
@ 2014-09-05 05:53  Vladimir Romanov <vromanov@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Vladimir Romanov @ 2014-09-05 05:53 UTC (permalink / raw)
  To: pgsql-odbc

Hello all!
I do some test with ODBC driver for PosgreSql, TimesTen & MySQL. I compare
performance on very simple request. Database always located on same PC as
test application. Test PC - Lenovo T500, Cnetos 6.5 64, 8 Gb RAM, SSD.
I found what PostgreSql ODBC driver is slowest in comparison.
IMHO problems related to protocol used. I can't use SHM connection to
server or even UNIX socket.

perftool report - http://freepcrf.com/files/db_test_pq.pdf
chart 1 (w/o timesten)  - http://freepcrf.com/files/drv_comp1.png
chart 2 - http://freepcrf.com/files/drv_comp2.png
test source - https://github.com/vvromanov/db_test

-- 
Vladimir Romanov

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: ODBC Driver performance comparison
@ 2014-09-05 06:40  Heikki Linnakangas <hlinnakangas@vmware.com>
  parent: Vladimir Romanov <vromanov@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Heikki Linnakangas @ 2014-09-05 06:40 UTC (permalink / raw)
  To: vromanov@gmail.com; pgsql-odbc

On 09/05/2014 08:53 AM, Vladimir Romanov wrote:
> Hello all!
> I do some test with ODBC driver for PosgreSql, TimesTen & MySQL. I compare
> performance on very simple request. Database always located on same PC as
> test application. Test PC - Lenovo T500, Cnetos 6.5 64, 8 Gb RAM, SSD.
> I found what PostgreSql ODBC driver is slowest in comparison.
> IMHO problems related to protocol used. I can't use SHM connection to
> server or even UNIX socket.

Actually, you can use a UNIX domain socket with psqlodbc. Just put the 
path to the socket, e.g. "/tmp", in the Servername property, instead of 
the hostname. That's assuming psqlodbc was compiled with libpq support, 
(--with-libpq configure option), but I'm pretty sure that's the default 
on all major distributions.

> perftool report - http://freepcrf.com/files/db_test_pq.pdf

Would be interesting to get the psqlodbc function names in the chart. 
Any chance you could re-run the benchmark with a debug-enabled build?

It's interesting that 10.7% of the runtime seems to be spent in 
__tz_convert() function, called indirectly by SQLExecute. Off the top of 
my head, I don't see where that call is coming from. I wouldn't expect 
SQLExecute to do much with timezones, at least when there are no 
timestamp fields involved.

It might also be fairly straightforward to optimize the sprintf/sscanf 
function calls. They're probably used to convert between integers and 
strings, and it should be possible write some sort of fast-paths for 
those conversions.

Are you measuring wall-clock time or CPU time? If it's CPU time, I'm 
surprised that the I/O-related syscalls, poll(), send() and recv(), are 
so high on the profile. If not, there isn't much you can do in the 
client side to make them faster, as the time is simply spent waiting for 
the server.

- Heikki


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: ODBC Driver performance comparison
@ 2014-09-05 11:00  Vladimir Romanov <vromanov@gmail.com>
  parent: Heikki Linnakangas <hlinnakangas@vmware.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Vladimir Romanov @ 2014-09-05 11:00 UTC (permalink / raw)
  To: Heikki Linnakangas <hlinnakangas@vmware.com>; +Cc: pgsql-odbc

Here also another test - http://freepcrf.com/files/my_vs_pq_vs_tt.png
There 3 runs of commercial application with constant load on same PC,
13:58-14:17 - mysql,
14:35-14:55 - PostgreSql,
15:03-15:20 - Timesten
You can see high softirq usage on Posgresql. This is network driver
related.

Here you can found information how performance report collected
http://gperftools.googlecode.com/svn/trunk/doc/cpuprofile.html.


On Fri, Sep 5, 2014 at 10:40 AM, Heikki Linnakangas <hlinnakangas@vmware.com
> wrote:

> On 09/05/2014 08:53 AM, Vladimir Romanov wrote:
>
>> Hello all!
>> I do some test with ODBC driver for PosgreSql, TimesTen & MySQL. I compare
>> performance on very simple request. Database always located on same PC as
>> test application. Test PC - Lenovo T500, Cnetos 6.5 64, 8 Gb RAM, SSD.
>> I found what PostgreSql ODBC driver is slowest in comparison.
>> IMHO problems related to protocol used. I can't use SHM connection to
>> server or even UNIX socket.
>>
>
> Actually, you can use a UNIX domain socket with psqlodbc. Just put the
> path to the socket, e.g. "/tmp", in the Servername property, instead of the
> hostname. That's assuming psqlodbc was compiled with libpq support,
> (--with-libpq configure option), but I'm pretty sure that's the default on
> all major distributions.
>
>  perftool report - http://freepcrf.com/files/db_test_pq.pdf
>>
>
> Would be interesting to get the psqlodbc function names in the chart. Any
> chance you could re-run the benchmark with a debug-enabled build?
>
> It's interesting that 10.7% of the runtime seems to be spent in
> __tz_convert() function, called indirectly by SQLExecute. Off the top of my
> head, I don't see where that call is coming from. I wouldn't expect
> SQLExecute to do much with timezones, at least when there are no timestamp
> fields involved.
>
> It might also be fairly straightforward to optimize the sprintf/sscanf
> function calls. They're probably used to convert between integers and
> strings, and it should be possible write some sort of fast-paths for those
> conversions.
>
> Are you measuring wall-clock time or CPU time? If it's CPU time, I'm
> surprised that the I/O-related syscalls, poll(), send() and recv(), are so
> high on the profile. If not, there isn't much you can do in the client side
> to make them faster, as the time is simply spent waiting for the server.
>
> - Heikki
>



-- 
Vladimir Romanov

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: ODBC Driver performance comparison
@ 2014-09-15 03:34  Craig Ringer <craig@2ndquadrant.com>
  parent: Heikki Linnakangas <hlinnakangas@vmware.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Craig Ringer @ 2014-09-15 03:34 UTC (permalink / raw)
  To: Heikki Linnakangas <hlinnakangas@vmware.com>; vromanov@gmail.com; pgsql-odbc

On 09/05/2014 02:40 PM, Heikki Linnakangas wrote:

> Are you measuring wall-clock time or CPU time? If it's CPU time, I'm
> surprised that the I/O-related syscalls, poll(), send() and recv(), are
> so high on the profile. If not, there isn't much you can do in the
> client side to make them faster, as the time is simply spent waiting for
> the server.

There's still potentially one big thing that can be done: reduce
round-trips.

For example, the PgJDBC driver sends multi-statements to the server by
writing a bunch of bind/parse/execute messsages, *then* waiting for a
response and processing each response as it receives it.

It can be worth looking at what's happening on the wire.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2014-09-15 03:34 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-09-05 05:53 ODBC Driver performance comparison Vladimir Romanov <vromanov@gmail.com>
2014-09-05 06:40 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2014-09-05 11:00   ` Vladimir Romanov <vromanov@gmail.com>
2014-09-15 03:34   ` Craig Ringer <craig@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox