Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver

Поиск
Список
Период
Сортировка
От Sérgio Saquetim
Тема Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver
Дата
Msg-id d2b756c0-cb16-4a4b-a893-33042a2d28a9@googlegroups.com
обсуждение исходный текст
Ответ на Severe performance degradation when using the 9.2-1000 JDBC 4 driver  ("emergency.shower@gmail.com" <emergency.shower@gmail.com>)
Ответы Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver  (Craig Ringer <ringerc@ringerc.id.au>)
Список pgsql-jdbc
I can confirm the problem, it's taking about 4000ms to get a Connection. I did a simple Java class to test that:


/*
 * JavaApplication1.java
 *
 * Criado em Oct 18, 2012, 12:40:56 AM
 *
 * Copyright(c) 2012 Sérgio Ernesto Diniz Saquetim. Todos os direitos reservados.
 */
package javaapplication1;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * [Insira a descrição da classe aqui]
 *
 * @author Sérgio Saquetim <sergiosaquetim@gmail.com>
 * @version 0.1
 * @since 0.1
 */
public class JavaApplication1 {

  /**
   * Função de entrada de execução do programa.
   *
   * @param args os argumentos da linha de comando
   */
  public static void main(String[] args) throws ClassNotFoundException, SQLException {
    Class.forName("org.postgresql.Driver");

    String url = "jdbc:postgresql://192.168.1.100/frames?user=postgres&password=postgres@mac";

    long time = System.currentTimeMillis();
    try (Connection conn = DriverManager.getConnection(url)) {
      System.out.println("Elapsed Time: "+(System.currentTimeMillis()-time));
      try (PreparedStatement pst = conn.prepareStatement("SELECT version();")) {
        try (ResultSet rs = pst.executeQuery()) {
          while (rs.next()) {
            System.out.println(rs.getString(1));
          }
        }
      }
    }
  }
}

The result using the : 9.2-1000 JDBC 4
run:
Elapsed Time: 5172
PostgreSQL 9.2.1 on x86_64-apple-darwin, compiled by i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
build5658) (LLVM build 2336.9.00), 64-bit 

Now using the 9.1-903 JDBC 4:
Elapsed Time: 50
PostgreSQL 9.2.1 on x86_64-apple-darwin, compiled by i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
build5658) (LLVM build 2336.9.00), 64-bit 

I'm getting the same results in my company what makes this Driver unusable in production. Is there any workaround? Will
Iget to much trouble if I use 9.1-903 JDBC 4 version driver with Postgres 9.2? 

Thanks a lot!








Em sexta-feira, 5 de outubro de 2012 16h27min21s UTC-3, "emergency.shower@gmail.com"  escreveu:
> Hi,
>
>
>
> after the upgrade the latest PortgreSQL 9.2-1000 JDBC 4 driver, we
>
> discovered a severe performance degradation when connecting to 8.4,
>
> 9.0, 9.1, and 9.2 servers.  In a test application the
>
> DriverManager#getConnection(String, String, String) call constantly
>
> took > 4500 ms compared to < 20 ms with the previous 9.1-903 JDBC 4
>
> driver. This makes the driver virtually unusable in production
>
> environments.
>
>
>
> Client: Windows 2008 R2, Windows 7
>
> Server: PostgreSQL 8.4, 9.0, 9.1, 9.2 on Linux 2.6
>
>
>
> Regards,
>
> Alex
>
>
>
>
>
> --
>
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>
> To make changes to your subscription:
>
> http://www.postgresql.org/mailpref/pgsql-jdbc


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Michael Daines
Дата:
Сообщение: PGCopyOutputStream Doesn't Hold Connection
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver