Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Increase the system's process limits System 10.4
Tiger only hintI had high hopes that OS X 10.4 would ship with a higher default maxproc. My old post on this subject still worked for 10.4, but what a pain that is, and you have to redo it after some System Update operations.

I just finished reading an article on launchd over at AFP548, and he mentions launchdctl for controlling launchd. One thing this utility allows you to do is set the resource limits for things that launchd launches. And one of the things that launchd starts is the WindowServer!

So, you just need to have launchd launch processes with a higher limit. If you run launchctl limit right now, you will see that the maxproc is set to 100. To change this, you need to create the /etc/launchd.conf file (if it does not already exist) and add the following line:
limit maxproc 512 2048
The first number is the soft limit and the second number is the hard limit. You can pick different values if you want.

NOTE: I've seen mentioned (at some place that I can't remember) that if you did an upgrade install to 10.4, your system might not be running launchd. This trick depends on launchd being PID 1 and thus launching WindowServer. If init launched your WindowServer, I'm afraid the old method will have to be your work around. You can check the PID of launchd by typing ps ax | grep launchd; the PID is the first number listed.

[robg adds: Read the referenced post for some background as to why you might want to increase the process limits; it probably doesn't apply to most typical users -- for example, I've never hit any process limits, so I'm not going to change the defaults. But if you have, this seems to be a good solution for 10.4...]
    •    
  • Currently 3.00 / 5
  You rated: 4 / 5 (4 votes cast)
 
[20,200 views]  

10.4: Increase the system's process limits | 14 comments | Create New Account
Click here to return to the '10.4: Increase the system's process limits' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Increase the system's process limits
Authored by: seqiro on Jul 20, '05 11:13:56AM
I'm not sure why Apple would have it set this way, nor if changing it will really improve the printd quality -- isn't it also dependent on the resolution of the source images?

Absolutely the image resolution makes a difference. The key is this: iPhoto is resizing the images for the PDF file before uploading.

So for example, the images I was using were 8MP files at 3504x2336. A full page of the large keepsake book is 8.5x11 and most of the pictures in the theme I used weren't full page anyway. Still, the pictures I was using would be over 300dpi at that size (7.3x11 @ 318dpi). However, the image uploaded by iPhoto is resized to 1650x1100 at 150dpi with the default settings when you choose a medium or large book. That is not NEARLY enough image data for a picture printed at that size.

The tradeoff? A much larger upload. But I can tell you that full page pictures in the small book looked terrific, and even the smallest pictures in the large book looked terrible. The change in DPI is the only difference I could come up with.

[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: seqiro on Jul 20, '05 11:18:07AM

oops, wrong thread *embarassed*.

That's what i get for having too many tabs open. Please delete these comments.



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: alblue on Jul 20, '05 11:40:00AM

Worryingly enough for my 10.4.2 server system, it reports:
maxproc 100 532

I can't see why it would limit it to 532 processes as a hard limit, especially seeing as it's supposed to be a server system!



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: stephendv on Jul 20, '05 11:53:33AM
Just to clarify, all 10.4 systems use launchd, whether you performed a clean install or an upgrade.

If you performed an upgrade to 10.4 then launchd is not used for network services, instead the old xinetd is used. But launchd is still used to launch all other daemons (in fact, launchd launches xinetd on upgraded systems) - so whether you performed a clean install or an upgrade should have no effect on this hint.

[ Reply to This | # ]

10.4: Increase the system's process limits
Authored by: rumirocks on Jul 20, '05 12:57:52PM

How do you create this file and where do you put it?

/etc/launchd.conf file

I know you have to do in terminal, but what are the steps before?

I know this is a baby question to all of you, but my system is SLUGGISH since this update and I have the 100/532 maxproc thingey.

thanks for your patience.



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: macshome on Jul 20, '05 01:04:21PM

Check our launchd article or the man page for launchctl for more details.

I think there was a hint here yesterday about it too. :)

---
http://www.afp548.com
Breaking my server to save yours.



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: pdm on Jul 20, '05 05:28:49PM

If your system is sluggish this isn't the problem. If you use terminal you would get "Cannot fork" errors, or if no applications could be launched. I reguarly have 30 or more terminals open and reguarly run into the 100 process limits.

Sorry, this wont be of any use to your problems are sluggish problems. Is is only raising the max number of concurrent processes per user.

---
-pdm



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: rumirocks on Jul 20, '05 06:18:50PM

PDM,

I have a thing on my menu bar that tells me what % of the processor is being used.

Since I upgraded to Tiger, it's at or near 100% most of the day. Even if all that is open is Mail.

This thing lists Processor, Uptime, Tasks/Threads, and Load Average.

That's what I call "sluggish." It was definitely not the case pre-Tiger upgrade.

The Activity Console shows WindowServer using the most of the CPU at all times.

I use Macaroni on automated schedules, DiskWarrior once a month, no dinky shareware that I dont investigate as seriously working. I am a responsible ignoramus user of this computer, and I scour Macosxhints every day even though I'm not a geek.

The parent post of this thread was the first hint that maybe I could do something about this.

Thanks for replying.



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: davidmorr on Jul 20, '05 07:41:33PM

It's probably Spotlight. I understand that it is constantly running whenever you do anything so it can index any new files. See the tips here for how to disable it.

David



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: ChrisAllison on Jul 27, '05 05:47:19PM
I have a thing on my menu bar that tells me what % of the processor is being used.

Since I upgraded to Tiger, it's at or near 100% most of the day. Even if all that is open is Mail.

This thing lists Processor, Uptime, Tasks/Threads, and Load Average.

The Processor readout indicates how much of your computer's processor is being used at any given time. The Tasks/Threads readout is specifying how many processes are running.

As you know from firsthand experience (ie: just having mail running), the number of processes is not necessarily tied directly to the percent of the processor being used. One process can tie up the entire cpu if it's either doing a lot of work (on purpose), or doing a lot of unecessary work (sitting there and spinning its wheels - malfunctioning).

That's what I call "sluggish." It was definitely not the case pre-Tiger upgrade.

The Activity Console shows WindowServer using the most of the CPU at all times.

The parent hint describes how to allow your computer run more processes, but from the sound of things, (WindowServer chewing up most of your processor), you need to fix what you already have running. Your problblockquote is not a limit on how many processes you can run, but one (perhaps more?) runaway process.

While I have not updated to Tiger yet, my experience with Major OS X updates has been performance improvblockquoteents, and I have not heard that contradicated anywhere. Sounds like something might be messed up on your systblockquote.

I use Macaroni on automated schedules, DiskWarrior once a month

A quick Google turned up this Macaroni Page. While it doesn't look (based on the description) that Macaroni could be responsible for the WindowServer running out of control, I don't really know anything about Macaroni, and it's possible that a failure to upgrade that (or perhaps some other systblockquote modification?) could be responsible.

Without knowing more about your system (and, ideally: access to it), I can't really tell you anything more, but I wish you luck in regaining those processor cycles.



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: ChrisAllison on Jul 27, '05 06:24:21PM
As was pointed out in the parent hint's linked blog post, "Every process you run from the GUI is launched by WindowServer." - Activity Console naming WindowServer as the problem is about as specific as blaming "the government" when some individual bureaucrat messes up.

I'm curious as to whether the top program would give a better output (actually name the offending process) than the Apple Activity Monitor (I don't think it should). Running the following command in a terminal will output a bunch of information you don't really care about (but which is useful in many circumstances), followed by a list of the top ten commands/processes (-n 10) which are using the cpu the most, sorted in descending order based on processor usage (-o -cpu), five times (-l 5):
top -o -cpu -n 10 -l 5
Scroll through that output (modifying it to take more samples if you so choose) to see if there are one or two commands named chewing up most of your processor.

Run with or without the limit (-l), top is a fairly processor intensive command (for the duration of its runtime), as it polls the cpu once a second to get a pretty comprehensive idea of what's going on... it's kind of like someone asking you how you feel every few seconds. Answering "How do you feel now? ... How do you feel now? ... How do you feel now? ..." over and over takes up some of your attention and thinking power. One of my theories is that the little menu bar gizmo you have reporting on Processor, Uptime, Tasks/Threads, and Load Average - all of which constitute a fair chunk of what top checks - might be responsible for the sluggish state of your machine, especially if you have it set to update every few seconds or less.

[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: GaelicWizard on Jul 21, '05 12:49:04AM

You do not need to create this file in the terminal. Create a plain text file (not a rich text file) with the mentioned contents. Save the file. In the Save dialog box, press apple-G and type "/etc" into the box that appears. name the file launchd.conf and it will ask you if you want to use .conf, .txt, or both for the file extension. Choose .conf. That's it.

JP

---
Pell



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: prentmee on Jul 22, '05 05:46:01AM

is there a way to see what these limits and others are set to before you start creating conf files?
In linux you can cat the files in proc to see more than you would ever want to know about the "system" setting. In AIX there are tuning cmds where you can do similar things.
By setting the launchd.conf file is there a way to verify that this has taken?
Is there a live file that could be checked to see other settings at the "system" level?

thanks
-pete

---
Any technology distinguishable from magic is insufficiently advanced



[ Reply to This | # ]
10.4: Increase the system's process limits
Authored by: deviantintegral on Jul 22, '05 10:43:41AM

These are the numbers on my machine:

maxproc 100 532

What happens to processes when you go over the soft limit? And is 100 a max system process limit or a max user process limit?



[ Reply to This | # ]