Skip navigation
This discussion is archived

ulimit how to

494 Views 6 Replies Latest reply: Apr 15, 2006 7:56 AM by Michael Bradshaw RSS
Michael Bradshaw Level 5 Level 5 (4,135 points)
Currently Being Moderated
Nov 16, 2005 8:10 AM
Does anyone have a good pointer to a FAQ/HowTo for setting ulimit on the mac. Something that covers where to look for signs that these limits are being hit (/var/log/???), which have to be set in sysctl and which in the shell...

TIA,
Mike
Mac OS X (10.4.3)
  • Gary Kerbaugh Level 6 Level 6 (18,040 points)
    Currently Being Moderated
    Nov 16, 2005 1:14 PM (in response to Michael Bradshaw)
    Hi Mike,
       I've never seen much on it. It's not a topic that lends itself to extensive discussion because each of the variables is different. There's very little that one can say that applies to all of them except to give the syntax for the command and to tell you how to set them using a sysctl.conf file. I did a Google Search: "sysctl.conf" and all of the hits on the first page were short. The best one looked like Tuning with sysctl from the FreeBSD Handbook but it is also short.

       You can read a variable to see if your setting "took" but seeing if it had any effect is quite dependent on the variable. For instance to test the effect of maxproc, someone here once wrote a script that simply spawned new processes until it failed.

       Also there are compiled in limits on some of the variables that I haven't seen documented. For instance, I think the absolute maxproc limit is just over 2000 because one time I tried setting it higher and the setting didn't "take" until I brought it down to about that range.

       Hopefully that gives you some idea why a lengthy discussion would be almost impossible. I'm sorry my news isn't better. Maybe someone has seen a really detailed discussion. I'd like to see it myself.
    --
    Gary
    ~~~~
       Steal this tagline. I did.
    G5, Mac OS X (10.4.3), 2x2.5 GHz, 2 Gig RAM
  • Nils C. Anderson Level 4 Level 4 (3,480 points)
    Currently Being Moderated
    Nov 16, 2005 5:32 PM (in response to Michael Bradshaw)
    Michael,

    While not a FAQ. perhaps this manpage will give you a better idea about just what's getting adjusted by ulimit.

    getrlimit, setrlimit -- control maximum system resource consumption

    Andy
    15in. PowerBook G4, Mac OS X (10.4.3)
  • Nils C. Anderson Level 4 Level 4 (3,480 points)
    Currently Being Moderated
    Nov 16, 2005 5:32 PM (in response to Michael Bradshaw)
    Michael,

    While not a FAQ. perhaps this manpage will give you a better idea about just what's getting adjusted by ulimit.

    getrlimit, setrlimit -- control maximum system resource consumption

    Andy
    15in. PowerBook G4, Mac OS X (10.4.3)
  • Nils C. Anderson Level 4 Level 4 (3,480 points)
    Currently Being Moderated
    Nov 17, 2005 5:12 AM (in response to Michael Bradshaw)
    Michael,

    just my 2 cents.

    to get an idea on how the various resource limits are set take a look at
    the kernel source. specifically the file xnu-792.6.22/bsd/kern/kern_resource.c, and the function dosetrlimit()

    you might be able to figure out the problem, by using ktrace/kdump. they will show you which system calls are being made. and from looking over the output it should be possible to get a idea about which resource limit that you are slamming into, base on what the application was attempting to do at the time (open, creat, brk, etc...).

    Andy
    15in. PowerBook G4, Mac OS X (10.4.3)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.