Lots of LOG: statement: select 'NpgsqlXXXXX'

18 views
Skip to first unread message

simeo...@gmail.com

unread,
Feb 16, 2015, 5:27:32 PM2/16/15
to npgsq...@googlegroups.com
Hello!

Scenario:
Server PostgreSQL 9.4 under freeBSD. HP T620
Client: Win7 C#

We had some performance problems and we decided to start intense log, and we have discovered that before every SQL there are some strange queries like this

LOG: statement: select 'Npgsql155171'
LOG: duration: 0.136 ms

The number is random.

It seems it's some test that npgsql makes to check connection, but it's very hard for us because we make thousands queries every minute and it affects performance.

How could us avoid this test?

Thanks and happy weekend to everybody

John Soekris

Francisco Figueiredo Jr.

unread,
Feb 16, 2015, 5:50:25 PM2/16/15
to simeo...@gmail.com, npgsq...@googlegroups.com
Hello, John!

You are right. This is a test Npgsql do to check if the connection is ok.
It comes from here:
https://github.com/npgsql/npgsql/blob/49f2326f637ab6d7ee5f84f6b724aad658f4c112/Npgsql/NpgsqlConnector.cs#L1600


Unfortunately, the only way to get rid of this test is to either
disable Npgsql connection pool or recompile Npgsql without the test.

Disable connection pool isn't advised because you will incur in the
overhead of opening a new connection each time, which is worse than
doing the check.

We have plans to remove this checking as it is giving performance
problems to users. We already have a patch
https://github.com/npgsql/npgsql/pull/452 which removes this checking.

Are you able to compile Npgsql from source? You will need Visual
Studio. You can use the 2013 Community Edition.

You will also need to use the 2.2 branch as the master branch is being
used to develop the next major 3.0 release.

You can find the 2.2 branch here:
https://github.com/npgsql/npgsql/tree/2.2

Another option is to download the source code from our latest 2.2
release from our github releases page:
https://github.com/npgsql/npgsql/releases/tag/v2.2.4.3

Please, let us know if you find any problem compiling Npgsql and/or
applying the patch.

I hope it helps.
> --
> You received this message because you are subscribed to the Google Groups
> "Npgsql Help" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to npgsql-help...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/npgsql-help/3be169be-6713-402d-9825-42b6aa9d28f2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://gplus.to/franciscojunior
http://fxjr.blogspot.com
http://twitter.com/franciscojunior
Reply all
Reply to author
Forward
0 new messages