473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Optimal configuration to eliminate "out of file descriptors" error

I'm trying to figure out what the optimal Postgres configuration would
be for my server (with 200 connecting clients, even though I'd really
like to get it up to 500).

I've got a 700 MHz eMac running Mac OS 10.3.2 (Panther) with 512 MB of
RAM. I've messed around with some settings but I'm still getting an
occasional "out of file descriptor" error, especially when performing a
VACUUM. Like so...

2004-04-13 23:30:05 LOG: out of file descriptors: Too many open files;
release and retry
CONTEXT: writing block 1 of relation 67553/16604

I'm going to do my best to provide my current system settings that
relate to Postgres. It would be great if someone could tell me where
I'm way off, and get me on the right track. I'm under the impression
that my machine should be able to handle 200 to 500 client connections.
If that's not the case, I'm fine with getting new hardware, I just
don't want to go to that step "willy nilly". Thanks!

1. Snipped from postgresql.conf (the only three settings I've changed)

max_connections = 200
...
shared_buffers = 2000
...
max_files_per_process = 100
2. Snipped from /etc/profile

ulimit -u 512
3. Snipped from /etc/rc

sysctl -w kern.sysv.shmmax=167772160
sysctl -w kern.sysv.shmmin=1
sysctl -w kern.sysv.shmmni=32
sysctl -w kern.sysv.shmseg=8
sysctl -w kern.sysv.shmall=65536
4. Snipped from etc/sysctl.conf

# Turn up maxproc
kern.maxproc=2048

# Turn up the maxproc per user
kern.maxprocperuid=512
Nov 23 '05 #1
4 5787
I have not received a response yet on this. Should I try another
postgres list or do I need to provide more information/clarity? Thanks.

On Apr 14, 2004, at 12:48 PM, Joe Lester wrote:
I'm trying to figure out what the optimal Postgres configuration would
be for my server (with 200 connecting clients, even though I'd really
like to get it up to 500).

I've got a 700 MHz eMac running Mac OS 10.3.2 (Panther) with 512 MB of
RAM. I've messed around with some settings but I'm still getting an
occasional "out of file descriptor" error, especially when performing
a VACUUM. Like so...

2004-04-13 23:30:05 LOG: out of file descriptors: Too many open
files; release and retry
CONTEXT: writing block 1 of relation 67553/16604

I'm going to do my best to provide my current system settings that
relate to Postgres. It would be great if someone could tell me where
I'm way off, and get me on the right track. I'm under the impression
that my machine should be able to handle 200 to 500 client
connections. If that's not the case, I'm fine with getting new
hardware, I just don't want to go to that step "willy nilly". Thanks!

1. Snipped from postgresql.conf (the only three settings I've changed)

max_connections = 200
...
shared_buffers = 2000
...
max_files_per_process = 100
2. Snipped from /etc/profile

ulimit -u 512
3. Snipped from /etc/rc

sysctl -w kern.sysv.shmmax=167772160
sysctl -w kern.sysv.shmmin=1
sysctl -w kern.sysv.shmmni=32
sysctl -w kern.sysv.shmseg=8
sysctl -w kern.sysv.shmall=65536
4. Snipped from etc/sysctl.conf

# Turn up maxproc
kern.maxproc=2048

# Turn up the maxproc per user
kern.maxprocperuid=512

Nov 23 '05 #2
On Thu, Apr 15, 2004 at 13:27:27 -0500,
Joe Lester <jo********@sweetwater.com> wrote:
I have not received a response yet on this. Should I try another
postgres list or do I need to provide more information/clarity? Thanks.
The performance list would be the natural place for getting information
on optimal configurations. It sounds like what is really happening is that
you are hitting an OS limit on the number of open files. You should be
able to increase that limit. There have also been some discussions about
postgres doing a better job of telling when it has opened too many files
within the last several months. I don't remember much about the details
of the change or which version they were applied to.

On Apr 14, 2004, at 12:48 PM, Joe Lester wrote:
I'm trying to figure out what the optimal Postgres configuration would
be for my server (with 200 connecting clients, even though I'd really
like to get it up to 500).

I've got a 700 MHz eMac running Mac OS 10.3.2 (Panther) with 512 MB of
RAM. I've messed around with some settings but I'm still getting an
occasional "out of file descriptor" error, especially when performing
a VACUUM. Like so...

2004-04-13 23:30:05 LOG: out of file descriptors: Too many open
files; release and retry
CONTEXT: writing block 1 of relation 67553/16604

I'm going to do my best to provide my current system settings that
relate to Postgres. It would be great if someone could tell me where
I'm way off, and get me on the right track. I'm under the impression
that my machine should be able to handle 200 to 500 client
connections. If that's not the case, I'm fine with getting new
hardware, I just don't want to go to that step "willy nilly". Thanks!

1. Snipped from postgresql.conf (the only three settings I've changed)

max_connections = 200
...
shared_buffers = 2000
...
max_files_per_process = 100
2. Snipped from /etc/profile

ulimit -u 512
3. Snipped from /etc/rc

sysctl -w kern.sysv.shmmax=167772160
sysctl -w kern.sysv.shmmin=1
sysctl -w kern.sysv.shmmni=32
sysctl -w kern.sysv.shmseg=8
sysctl -w kern.sysv.shmall=65536
4. Snipped from etc/sysctl.conf

# Turn up maxproc
kern.maxproc=2048

# Turn up the maxproc per user

kern.maxprocperuid=512


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3
Bruno Wolff III <br***@wolff.to> writes:
It sounds like what is really happening is that
you are hitting an OS limit on the number of open files. You should be
able to increase that limit. There have also been some discussions about
postgres doing a better job of telling when it has opened too many files
within the last several months. I don't remember much about the details
of the change or which version they were applied to.


If I recall that change correctly, it was prompted by the discovery that
on OS X we were drastically underestimating the number of open file
descriptors sucked up per backend. (OS X treats each semaphore as an
open file, so there are about max_connections open files per process
that we weren't accounting for.) I think it is just in CVS tip and not
yet in any released version.

For the moment the answer is to size your kernel file table on the
assumption that you need about max_connections * (max_files_per_process
+ max_connections) filetable slots just for Postgres, plus whatever you
want available for the rest of the system.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #4
Yeah. It was my shell that was the bottleneck. What did the trick was
adding this line in /etc/profile:

ulimit -n 8000

Thanks!
Bruno Wolff III <br***@wolff.to> writes:
It sounds like what is really happening is that
you are hitting an OS limit on the number of open files. You should be
able to increase that limit. There have also been some discussions
about
postgres doing a better job of telling when it has opened too many
files
within the last several months. I don't remember much about the
details
of the change or which version they were applied to.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Serge calderara | last post by:
Dear all, Does any one have a ready class that is able to access a configuration file and make different type of querry, read, write operation? Why re invanting the real if something already...
2
by: Peter | last post by:
Hello, Thanks for reviewing my question. I am trying to understand how to use a configuration file for my application, so I can turn debug or trace with a switch. The following is what I put...
2
by: Joel Cade | last post by:
I'm having a problem with ASP.Net on a machine with both .Net Framework 1.0 and 1.1. This application is targeted to 1.0 using IIS application extension mappings. The following error page is...
3
by: hB | last post by:
Hi. Error = "The configuration system can only be set once. Configuration system is already set" Exception Details: System.InvalidOperationExcepti­on: The configuration system can only...
0
by: yma | last post by:
Hi, I have a web.config file that contains <httpHandlers> section that causes "cannot load file..." error. If I delete this section, it is OK. Why did vb.net add this section? It does not add...
2
by: genojoe | last post by:
http://msdn2.microsoft.com/en-us/library/system.configuration.configuration This site contains sample code that does not compile for me. The line of code is: ' Get the current configuration...
0
by: DBC User | last post by:
Hi, I am using a dll which uses WSE3 and to use it, I am trying to add microsoft.web.service3 secontion <microsoft.web.services3> <messaging> <mtom clientMode="On" /> </messaging>...
2
by: Alan T | last post by:
I have created a class library called Employee.dll and created a configuration file called Convert.config in this project. What should I use to open this config file: <?xml version="1.0"...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
5
by: Author | last post by:
This may sound like a silly question. I rarely do console or windows form applications. In a console application, I have an XML configuration file. I place it under my application root. In...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.