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

Re: BUG #1605: Is this a bug of PostgreSQL?Or, is the parameter of Windows set?

From: <sawait(at)nttdata(dot)co(dot)jp>
To: <sawait(at)nttdata(dot)co(dot)jp>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #1605: Is this a bug of PostgreSQL?Or, is the parameter of Windows set?
Date: 2005-04-20 08:47:01
Message-ID: B5512C3321BD3B49AEFDC4807E6945890124F26C@MAILSV22.msg.nttdata.co.jp (view raw or flat)
Thread:
Lists: pgsql-bugs
It is Sawai. 

I am sorry. There is a correction. 

>The following server logs are output when the program that gets a large 
>amount of Connection with PostgreSQL8.0.1/8.0.2 is operated, and PostgreSQL
>stops. Concretely, all the postgres processes and the postmaster processes
>stop. 

Only the postmaster process ends. 
The postgres process in the state of gettting the connection 
is the state as it is. 

--------------
It is information on the supplementation. 

-PostgreSQL8.0.1/8.0.2 can both get 500 connections in the Linux environment
without 
trouble. 

-It did not solve it though"/3GB/Userva=2900" and option were added to
"boot.ini". 

-The same situation was able to be reproduced by changing registry
information though the connection of another problem was not able to be
acquired in the environment of Windows XP. 

HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentContrilSet -> Control -> Session
Manager -> SubSystem
(default)Windows SharedSection=1024,3072,512
(After it changes)Windows SharedSection=1024,3072,1024


-----Original Message-----
From: OSD 澤井 健(技術開発) 
Sent: Monday, April 18, 2005 2:17 PM
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1605: Is this a bug of PostgreSQL?Or, is the parameter of
Windows set?



The following bug has been logged online:

Bug reference:      1605
Logged by:          Takehsi Sawai
Email address:      sawait(at)nttdata(dot)co(dot)jp
PostgreSQL version: 8.0.1/8.0.2
Operating system:   Windows 2003 Server
Description:        Is this a bug of PostgreSQL?Or, is the parameter of
Windows set?
Details: 

Hi. 

I'm from Japan. Sorry for my English.


The following server logs are output when the program that gets a large 
amount of Connection with PostgreSQL8.0.1/8.0.2 is operated, and PostgreSQL

stops. Concretely, all the postgres processes and the postmaster processes
stop. 

It reproduces without fail without fail, and, every time, it fails because
of 
the acquisition of the connection of piece 490. 


---- PostgreSQL Server Log ----
(DEBUG5)
>2005-04-13 08:14:43 FATAL:  XX000: could not create sigchld waiter thread:
error code 8
>2005-04-13 08:14:43 LOCATION:  internal_forkexec, postmaster.c:3143
-------------------------------


The environment of the machine and the setting of PostgreSQL are as follows.



---- spec ----
CPU:Xeon 2.4GHz x 1
Mem:2GB
HD:73GB?2(RAID-1)
OS:Windows Server 2003(Standard/Enterprise)
-------------------------------

---- postgresql.conf ----
listen_addresses='*'
max_connections=1000
shared_buffer=2000
-------------------------------

From log Function CreateThread, and to failure, and error code 8=
ERROR_NOT_ENOUGH_MEMORY native of win32

However, the memory that can be used seems to have room enough from 
Windows task manager -> performance. 
Is this a bug of PostgreSQL?Or, is the parameter of Windows set?


---- postmaster.c ----
(line 3138 - 3144)
>	waiterThread = CreateThread(NULL, 64 * 1024, win32_sigchld_waiter,
>								(LPVOID)
childHandleCopy, 0, NULL);
>	if (!waiterThread)
>		ereport(FATAL,
>		   (errmsg_internal("could not create sigchld waiter thread:
error code
%d",
>							(int)
GetLastError())));
-------------------------------

---- Link MSDN ----
CreateThread
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/bas
e/createthread.asp
ERROR CODE
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/
system_error_codes__0-499_.asp
-------------------------------

Program for test as follows

---- Simple Java program ----
(JDBC Driver : postgresql-8.0-310.jdbc3.jar)
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Iterator;


public class ConnectionCheck {

	public static void main(String[] args) {
		String driver = "org.postgresql.Driver";
		String url = "jdbc:postgresql://10.8.255.131:5432/eval-pg";
		String user = "eval-pg";
		String password = "kayabacho";
		
		Statement stmt = null;
		PreparedStatement pstmt = null;
		ResultSet rs = null;
		Connection con = null;
		int status = 1;
		int count = 0;
		
		int maxConnection = 1000;
		int numConnection = 0;
		int numCloseConnection = 0;
		ArrayList conList = new ArrayList();
		Iterator it = null;
		
		//CLASS LOADER
		try {
			Class.forName(driver);
		} catch (ClassNotFoundException e) {
			// TODO: handle exception
			e.printStackTrace();
			status = 0;
		}
		
		//TEST
		try {
			for(int i = 0; i < maxConnection; i++){
				con =
DriverManager.getConnection(url,user,password);
				
				if(con != null){
					numConnection++;
					conList.add(con);
					System.out.println("# of Connection
is " + numConnection + " : ok");
				}
				else{
					throw new SQLException();
				}
			}
			
		} catch (SQLException e) {
			// TODO: handle exception
			e.printStackTrace();
			status = 0;
		}
		
		//close
		try {
			numCloseConnection = numConnection;
			it = conList.iterator();
			while(it.hasNext()){
				con = (Connection)it.next();
				if(con != null || !con.isClosed()){
					con.close();
					numCloseConnection--;
					System.out.println("# of Result
Connection is " + numCloseConnection +
" : ok");
				}
			}
		} catch (SQLException e) {
			// TODO: handle exception
			e.printStackTrace();
			status = 0;
		}
		
		System.out.println("# of Get Connection is " + numConnection
+ " : ");
		System.out.println("--END");
		
		return;
	}
}
-------------------------------

---- Exception from Simple Java program(at 490 connection) ----
org.postgresql.util.PSQLException: Connection refused. Check that the
hostname and port are correct and that the postmaster is accepting TCP/IP
connections.
	at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFa
ctoryImpl.java:122)
	at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:
65)
	at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.
java:117)
	at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.
java:30)
	at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:
24)
	at org.postgresql.Driver.connect(Driver.java:235)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at ConnectionCheck.main(ConnectionCheck.java:58)
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.<init>(Unknown Source)
	at java.net.Socket.<init>(Unknown Source)
	at org.postgresql.core.PGStream.<init>(PGStream.java:58)
	at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFa
ctoryImpl.java:77)
	... 8 more
-------------------------------

pgsql-bugs by date

Next:From: PaulDate: 2005-04-20 14:46:51
Subject: BUG #1608: integer negative limit in plpgsql function arguments
Previous:From: Richard HuxtonDate: 2005-04-19 15:06:28
Subject: Re: How Ican to upgrade to Latest Version of postgresql

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