Thread: server process (PID 1304) was terminated by exception 0xC0000142

server process (PID 1304) was terminated by exception 0xC0000142

From
Haiming Zhang
Date:

Hi all,

 

I am Haiming, a software engineer.

 

One of our product is depending on PostgreSQL. I am facing a problem that it somehow always gave me an error " server process (PID 1304) was terminated by exception 0xC0000142." or " No buffer space available (maximum connections reached?): connect". I searched around and tried different configuration, but I still have not gotten any luck.

Any help would be appreciated.

 

Setup:

                1. Postgresql 9.1

                2. Product language: Java

                3. JDBC Pool: BoneCP 

Here is my config:

idleConnectionTestPeriod = 60

idleMaxAge = 240

maxConnectionsPerPartition  = 35

minConnectionsPerPartition = 10

partitionCount =  5

 

and in postgresql.conf:

max_connections = 600

shared_buffers = 32MB

others are as default.

 

This configuration is deployed in Windows XP with 4G Ram.

 

I also tried Windows 7 and Windows Server 2008, the same issue occured.

For Server 2008, my config is:

idleConnectionTestPeriod = 60

idleMaxAge = 240

maxConnectionsPerPartition  = 100

minConnectionsPerPartition = 5

partitionCount =  5

 

and in postgresql.conf:

max_connections = 2000

shared_buffers = 2G

others are as default.

 

Many thanks

 

Haiming Zhang

Software Engineer

 



If you are not an authorised recipient of this e-mail, please contact me at Redflex immediately by return phone call or by email. In this case, you should not read, print, retransmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments are confidential and may contain privileged information and/or copyright material of Redflex or third parties. You should only retransmit, distribute or commercialise the material if you are authorised to do so. This notice should not be removed.

Re: server process (PID 1304) was terminated by exception 0xC0000142

From
gelin yan
Date:


On Mon, Oct 8, 2012 at 9:02 AM, Haiming Zhang <Haiming.Zhang@redflex.com.au> wrote:

Hi all,

 

I am Haiming, a software engineer.

 

One of our product is depending on PostgreSQL. I am facing a problem that it somehow always gave me an error " server process (PID 1304) was terminated by exception 0xC0000142." or " No buffer space available (maximum connections reached?): connect". I searched around and tried different configuration, but I still have not gotten any luck.

Any help would be appreciated.

 

Setup:

                1. Postgresql 9.1

                2. Product language: Java

                3. JDBC Pool: BoneCP 

Here is my config:

idleConnectionTestPeriod = 60

idleMaxAge = 240

maxConnectionsPerPartition  = 35

minConnectionsPerPartition = 10

partitionCount =  5

 

and in postgresql.conf:

max_connections = 600

shared_buffers = 32MB

others are as default.

 

This configuration is deployed in Windows XP with 4G Ram.

 

I also tried Windows 7 and Windows Server 2008, the same issue occured.

For Server 2008, my config is:

idleConnectionTestPeriod = 60

idleMaxAge = 240

maxConnectionsPerPartition  = 100

minConnectionsPerPartition = 5

partitionCount =  5

 

and in postgresql.conf:

max_connections = 2000

shared_buffers = 2G

others are as default.

 

Many thanks

 

Haiming Zhang

Software Engineer

 



If you are not an authorised recipient of this e-mail, please contact me at Redflex immediately by return phone call or by email. In this case, you should not read, print, retransmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments are confidential and may contain privileged information and/or copyright material of Redflex or third parties. You should only retransmit, distribute or commercialise the material if you are authorised to do so. This notice should not be removed.


Hi

  Could you try reducing your max_connection to 100 or some smaller numbers? also you may try 64 bit version if yours isn't.

Regards

gelin yan

Re: server process (PID 1304) was terminated by exception 0xC0000142

From
Scott Marlowe
Date:
On Sun, Oct 7, 2012 at 9:27 PM, gelin yan <dynamicgl@gmail.com> wrote:
>
>
> On Mon, Oct 8, 2012 at 9:02 AM, Haiming Zhang <Haiming.Zhang@redflex.com.au>
> wrote:
>>
>> Hi all,
>>
>>
>>
>> I am Haiming, a software engineer.
>>
>>
>>
>> One of our product is depending on PostgreSQL. I am facing a problem that
>> it somehow always gave me an error " server process (PID 1304) was
>> terminated by exception 0xC0000142." or " No buffer space available (maximum
>> connections reached?): connect". I searched around and tried different
>> configuration, but I still have not gotten any luck.
>>
>> Any help would be appreciated.
>>
>>
>>
>> Setup:
>>
>>                 1. Postgresql 9.1
>>
>>                 2. Product language: Java
>>
>>                 3. JDBC Pool: BoneCP
>>
>> Here is my config:
>>
>> idleConnectionTestPeriod = 60
>>
>> idleMaxAge = 240
>>
>> maxConnectionsPerPartition  = 35
>>
>> minConnectionsPerPartition = 10
>>
>> partitionCount =  5
>>
>>
>>
>> and in postgresql.conf:
>>
>> max_connections = 600
>>
>> shared_buffers = 32MB
>>
>> others are as default.
>>
>>
>>
>> This configuration is deployed in Windows XP with 4G Ram.
>>
>>
>>
>> I also tried Windows 7 and Windows Server 2008, the same issue occured.
>>
>> For Server 2008, my config is:
>>
>> idleConnectionTestPeriod = 60
>>
>> idleMaxAge = 240
>>
>> maxConnectionsPerPartition  = 100
>>
>> minConnectionsPerPartition = 5
>>
>> partitionCount =  5
>>
>>
>>
>> and in postgresql.conf:
>>
>> max_connections = 2000
>>
>> shared_buffers = 2G
>>
>> others are as default.
>>
>>
>>
>> Many thanks
>>
>>
>>
>> Haiming Zhang
>>
>> Software Engineer
>>
>>
>>
>>
>> ________________________________
>> If you are not an authorised recipient of this e-mail, please contact me
>> at Redflex immediately by return phone call or by email. In this case, you
>> should not read, print, retransmit, store or act in reliance on this e-mail
>> or any attachments, and should destroy all copies of them. This e-mail and
>> any attachments are confidential and may contain privileged information
>> and/or copyright material of Redflex or third parties. You should only
>> retransmit, distribute or commercialise the material if you are authorised
>> to do so. This notice should not be removed.
>>
>
> Hi
>
>   Could you try reducing your max_connection to 100 or some smaller numbers?
> also you may try 64 bit version if yours isn't.

If the OP needs > 100 connections on the app end, he should add a
connection pooler like pgbouncer or pgpool.  pgbouncer is the easier
of the two to configure.


Re: server process (PID 1304) was terminated by exception 0xC0000142

From
gelin yan
Date:


On Mon, Oct 8, 2012 at 1:56 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Sun, Oct 7, 2012 at 9:27 PM, gelin yan <dynamicgl@gmail.com> wrote:
>
>
> On Mon, Oct 8, 2012 at 9:02 AM, Haiming Zhang <Haiming.Zhang@redflex.com.au>
> wrote:
>>
>> Hi all,
>>
>>
>>
>> I am Haiming, a software engineer.
>>
>>
>>
>> One of our product is depending on PostgreSQL. I am facing a problem that
>> it somehow always gave me an error " server process (PID 1304) was
>> terminated by exception 0xC0000142." or " No buffer space available (maximum
>> connections reached?): connect". I searched around and tried different
>> configuration, but I still have not gotten any luck.
>>
>> Any help would be appreciated.
>>
>>
>>
>> Setup:
>>
>>                 1. Postgresql 9.1
>>
>>                 2. Product language: Java
>>
>>                 3. JDBC Pool: BoneCP
>>
>> Here is my config:
>>
>> idleConnectionTestPeriod = 60
>>
>> idleMaxAge = 240
>>
>> maxConnectionsPerPartition  = 35
>>
>> minConnectionsPerPartition = 10
>>
>> partitionCount =  5
>>
>>
>>
>> and in postgresql.conf:
>>
>> max_connections = 600
>>
>> shared_buffers = 32MB
>>
>> others are as default.
>>
>>
>>
>> This configuration is deployed in Windows XP with 4G Ram.
>>
>>
>>
>> I also tried Windows 7 and Windows Server 2008, the same issue occured.
>>
>> For Server 2008, my config is:
>>
>> idleConnectionTestPeriod = 60
>>
>> idleMaxAge = 240
>>
>> maxConnectionsPerPartition  = 100
>>
>> minConnectionsPerPartition = 5
>>
>> partitionCount =  5
>>
>>
>>
>> and in postgresql.conf:
>>
>> max_connections = 2000
>>
>> shared_buffers = 2G
>>
>> others are as default.
>>
>>
>>
>> Many thanks
>>
>>
>>
>> Haiming Zhang
>>
>> Software Engineer
>>
>>
>>
>>
>> ________________________________
>> If you are not an authorised recipient of this e-mail, please contact me
>> at Redflex immediately by return phone call or by email. In this case, you
>> should not read, print, retransmit, store or act in reliance on this e-mail
>> or any attachments, and should destroy all copies of them. This e-mail and
>> any attachments are confidential and may contain privileged information
>> and/or copyright material of Redflex or third parties. You should only
>> retransmit, distribute or commercialise the material if you are authorised
>> to do so. This notice should not be removed.
>>
>
> Hi
>
>   Could you try reducing your max_connection to 100 or some smaller numbers?
> also you may try 64 bit version if yours isn't.

If the OP needs > 100 connections on the app end, he should add a
connection pooler like pgbouncer or pgpool.  pgbouncer is the easier
of the two to configure.


Hi

   I have ran a PG 9.1 instance on windows 7 for one year flawlessly, My max_connection is 100 only. It is a high load app. I think increasing connection number doesn't help due to pg's architecture. As other guys said, it is better to use sth like conn pool to manage connections.

BTW, you can check:

http://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows

it mention why pg can't launch more that 125 connections on windows. I think this point is still valid today.

Regards

gelin yan


Re: server process (PID 1304) was terminated by exception 0xC0000142

From
Scott Marlowe
Date:
On Mon, Oct 8, 2012 at 1:36 AM, gelin yan <dynamicgl@gmail.com> wrote:
>
>
> On Mon, Oct 8, 2012 at 1:56 PM, Scott Marlowe <scott.marlowe@gmail.com>
> wrote:

>> If the OP needs > 100 connections on the app end, he should add a
>> connection pooler like pgbouncer or pgpool.  pgbouncer is the easier
>> of the two to configure.
>
>
>
> Hi
>
>    I have ran a PG 9.1 instance on windows 7 for one year flawlessly, My
> max_connection is 100 only. It is a high load app. I think increasing
> connection number doesn't help due to pg's architecture. As other guys said,
> it is better to use sth like conn pool to manage connections.
>
> BTW, you can check:
>
> http://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows
>
> it mention why pg can't launch more that 125 connections on windows. I think
> this point is still valid today.

Yeah the problems with running pg on non unix platforms is all the
OTHER stuff, like pgbouncer / pgpool and so on that may or may not
support windows or are only partially supported.  And yeah I think the
limit for connections is still there, but there may be a kernel
configuration hack to overcome it.