From gregdingle at yahoo.com Sat Jul 7 16:16:41 2007 From: gregdingle at yahoo.com (Greg Dingle) Date: Sat Jul 7 16:16:46 2007 Subject: [launchd-dev] resource limits Message-ID: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> Hi, I'm just trying to get the resource limits working with launchd and a plist. Whatever I try I get a segmentation fault. I've tried with an empty dict: Label TEST OnDemand ProgramArguments /bin/ls SoftResourceLimits And also with some dummy values: Label TEST OnDemand ProgramArguments /bin/ls SoftResourceLimits Core 10000000000 CPU 10000000000 Data 10000000000 FileSize 10000000000 MemoryLock 10000000000 NumberOfFiles 8192 NumberofProcesses 150 ResidentSetSize 100000000 Stack 10000 Do I at least have the format correct? I couldn't find any examples with google to work from. Cheers, Greeg From zarzycki at apple.com Mon Jul 9 09:20:49 2007 From: zarzycki at apple.com (Dave Zarzycki) Date: Mon Jul 9 09:20:53 2007 Subject: [launchd-dev] resource limits In-Reply-To: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> References: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> Message-ID: <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> Which build of the OS? On Jul 7, 2007, at 4:16 PM, Greg Dingle wrote: > Hi, I'm just trying to get the resource limits working with launchd > and a plist. Whatever I try I get a segmentation fault. > > I've tried with an empty dict: > > > "> > > > Label > TEST > OnDemand > > ProgramArguments > > /bin/ls > > > SoftResourceLimits > > > > > > > And also with some dummy values: > > > "> > > > Label > TEST > OnDemand > > ProgramArguments > > /bin/ls > > > SoftResourceLimits > > Core > 10000000000 > > CPU > 10000000000 > > Data > 10000000000 > > FileSize > 10000000000 > > MemoryLock > 10000000000 > > NumberOfFiles > 8192 > > NumberofProcesses > 150 > > ResidentSetSize > 100000000 > > Stack > 10000 > > > > > > Do I at least have the format correct? I couldn't find any examples > with google to work from. > > Cheers, > > Greeg > > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev From gregdingle at yahoo.com Mon Jul 9 11:00:09 2007 From: gregdingle at yahoo.com (Greg Dingle) Date: Mon Jul 9 11:00:21 2007 Subject: [launchd-dev] resource limits In-Reply-To: <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> References: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> Message-ID: <3E3B9544-D8D3-4D5A-8AD6-5683C68365ED@yahoo.com> The build is 10.4.10. On 9-Jul-07, at 9:20 AM, Dave Zarzycki wrote: > Which build of the OS? > > > On Jul 7, 2007, at 4:16 PM, Greg Dingle wrote: > >> Hi, I'm just trying to get the resource limits working with >> launchd and a plist. Whatever I try I get a segmentation fault. >> >> I've tried with an empty dict: >> >> >> > "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >> >> >> Label >> TEST >> OnDemand >> >> ProgramArguments >> >> /bin/ls >> >> >> SoftResourceLimits >> >> >> >> >> >> >> And also with some dummy values: >> >> >> > "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >> >> >> Label >> TEST >> OnDemand >> >> ProgramArguments >> >> /bin/ls >> >> >> SoftResourceLimits >> >> Core >> 10000000000 >> >> CPU >> 10000000000 >> >> Data >> 10000000000 >> >> FileSize >> 10000000000 >> >> MemoryLock >> 10000000000 >> >> NumberOfFiles >> 8192 >> >> NumberofProcesses >> 150 >> >> ResidentSetSize >> 100000000 >> >> Stack >> 10000 >> >> >> >> >> >> Do I at least have the format correct? I couldn't find any >> examples with google to work from. >> >> Cheers, >> >> Greeg >> >> _______________________________________________ >> launchd-dev mailing list >> launchd-dev@lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo/launchd-dev > From zarzycki at apple.com Mon Jul 9 13:28:57 2007 From: zarzycki at apple.com (Dave Zarzycki) Date: Mon Jul 9 13:28:58 2007 Subject: [launchd-dev] resource limits In-Reply-To: <3E3B9544-D8D3-4D5A-8AD6-5683C68365ED@yahoo.com> References: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> <3E3B9544-D8D3-4D5A-8AD6-5683C68365ED@yahoo.com> Message-ID: <31182FBA-61EE-4860-A84F-EADA39569C35@apple.com> Sadly, in retrospect, it looks like the soft/hard limit code in Tiger (not Leopard) contains an easily confusable implementation. Can you wait until Leopard? davez On Jul 9, 2007, at 11:00 AM, Greg Dingle wrote: > The build is 10.4.10. > > On 9-Jul-07, at 9:20 AM, Dave Zarzycki wrote: > >> Which build of the OS? >> >> >> On Jul 7, 2007, at 4:16 PM, Greg Dingle wrote: >> >>> Hi, I'm just trying to get the resource limits working with >>> launchd and a plist. Whatever I try I get a segmentation fault. >>> >>> I've tried with an empty dict: >>> >>> >>> >> "> >>> >>> >>> Label >>> TEST >>> OnDemand >>> >>> ProgramArguments >>> >>> /bin/ls >>> >>> >>> SoftResourceLimits >>> >>> >>> >>> >>> >>> >>> And also with some dummy values: >>> >>> >>> >> "> >>> >>> >>> Label >>> TEST >>> OnDemand >>> >>> ProgramArguments >>> >>> /bin/ls >>> >>> >>> SoftResourceLimits >>> >>> Core >>> 10000000000 >>> >>> CPU >>> 10000000000 >>> >>> Data >>> 10000000000 >>> >>> FileSize >>> 10000000000 >>> >>> MemoryLock >>> 10000000000 >>> >>> NumberOfFiles >>> 8192 >>> >>> NumberofProcesses >>> 150 >>> >>> ResidentSetSize >>> 100000000 >>> >>> Stack >>> 10000 >>> >>> >>> >>> >>> >>> Do I at least have the format correct? I couldn't find any >>> examples with google to work from. >>> >>> Cheers, >>> >>> Greeg >>> >>> _______________________________________________ >>> launchd-dev mailing list >>> launchd-dev@lists.macosforge.org >>> http://lists.macosforge.org/mailman/listinfo/launchd-dev >> > From gregdingle at yahoo.com Mon Jul 9 13:38:32 2007 From: gregdingle at yahoo.com (Greg Dingle) Date: Mon Jul 9 13:38:43 2007 Subject: [launchd-dev] resource limits In-Reply-To: <31182FBA-61EE-4860-A84F-EADA39569C35@apple.com> References: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> <3E3B9544-D8D3-4D5A-8AD6-5683C68365ED@yahoo.com> <31182FBA-61EE-4860-A84F-EADA39569C35@apple.com> Message-ID: No, sorry, can't wait until Leopard. I want to use the resource limits for a program currently running on a production server. What is thing that is easily confused? I have tried both soft/hard limits -- that is not what you mean, is it? Is the implementation actually broken? I thought somebody here could just clarify the form for setting the limits. Greg On 9-Jul-07, at 1:28 PM, Dave Zarzycki wrote: > Sadly, in retrospect, it looks like the soft/hard limit code in > Tiger (not Leopard) contains an easily confusable implementation. > Can you wait until Leopard? > > davez > > > On Jul 9, 2007, at 11:00 AM, Greg Dingle wrote: > >> The build is 10.4.10. >> >> On 9-Jul-07, at 9:20 AM, Dave Zarzycki wrote: >> >>> Which build of the OS? >>> >>> >>> On Jul 7, 2007, at 4:16 PM, Greg Dingle wrote: >>> >>>> Hi, I'm just trying to get the resource limits working with >>>> launchd and a plist. Whatever I try I get a segmentation fault. >>>> >>>> I've tried with an empty dict: >>>> >>>> >>>> >>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >>>> >>>> >>>> Label >>>> TEST >>>> OnDemand >>>> >>>> ProgramArguments >>>> >>>> /bin/ls >>>> >>>> >>>> SoftResourceLimits >>>> >>>> >>>> >>>> >>>> >>>> >>>> And also with some dummy values: >>>> >>>> >>>> >>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >>>> >>>> >>>> Label >>>> TEST >>>> OnDemand >>>> >>>> ProgramArguments >>>> >>>> /bin/ls >>>> >>>> >>>> SoftResourceLimits >>>> >>>> Core >>>> 10000000000 >>>> >>>> CPU >>>> 10000000000 >>>> >>>> Data >>>> 10000000000 >>>> >>>> FileSize >>>> 10000000000 >>>> >>>> MemoryLock >>>> 10000000000 >>>> >>>> NumberOfFiles >>>> 8192 >>>> >>>> NumberofProcesses >>>> 150 >>>> >>>> ResidentSetSize >>>> 100000000 >>>> >>>> Stack >>>> 10000 >>>> >>>> >>>> >>>> >>>> >>>> Do I at least have the format correct? I couldn't find any >>>> examples with google to work from. >>>> >>>> Cheers, >>>> >>>> Greeg >>>> >>>> _______________________________________________ >>>> launchd-dev mailing list >>>> launchd-dev@lists.macosforge.org >>>> http://lists.macosforge.org/mailman/listinfo/launchd-dev >>> >> > From zarzycki at apple.com Mon Jul 9 13:43:09 2007 From: zarzycki at apple.com (Dave Zarzycki) Date: Mon Jul 9 13:43:13 2007 Subject: [launchd-dev] resource limits In-Reply-To: References: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> <3E3B9544-D8D3-4D5A-8AD6-5683C68365ED@yahoo.com> <31182FBA-61EE-4860-A84F-EADA39569C35@apple.com> Message-ID: <66D414D5-6A9F-438F-AAFB-94F08DF912B1@apple.com> Syntactically, what you added to your property list is correct. The bug in launchd (fixed in Leopard) is difficult to explain. I think the most pragmatic thing to do on a Tiger based system is to do is wrap the daemon in a quick shell script and have it adjust the resource limit you want. For example: #!/bin/sh ulimit -c 0 exec /usr/sbin/serverd davez On Jul 9, 2007, at 1:38 PM, Greg Dingle wrote: > No, sorry, can't wait until Leopard. I want to use the resource > limits for a program currently running on a production server. > > What is thing that is easily confused? I have tried both soft/hard > limits -- that is not what you mean, is it? Is the implementation > actually broken? I thought somebody here could just clarify the form > for setting the limits. > > Greg > > On 9-Jul-07, at 1:28 PM, Dave Zarzycki wrote: > >> Sadly, in retrospect, it looks like the soft/hard limit code in >> Tiger (not Leopard) contains an easily confusable implementation. >> Can you wait until Leopard? >> >> davez >> >> >> On Jul 9, 2007, at 11:00 AM, Greg Dingle wrote: >> >>> The build is 10.4.10. >>> >>> On 9-Jul-07, at 9:20 AM, Dave Zarzycki wrote: >>> >>>> Which build of the OS? >>>> >>>> >>>> On Jul 7, 2007, at 4:16 PM, Greg Dingle wrote: >>>> >>>>> Hi, I'm just trying to get the resource limits working with >>>>> launchd and a plist. Whatever I try I get a segmentation fault. >>>>> >>>>> I've tried with an empty dict: >>>>> >>>>> >>>>> >>>> "> >>>>> >>>>> >>>>> Label >>>>> TEST >>>>> OnDemand >>>>> >>>>> ProgramArguments >>>>> >>>>> /bin/ls >>>>> >>>>> >>>>> SoftResourceLimits >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> And also with some dummy values: >>>>> >>>>> >>>>> >>>> "> >>>>> >>>>> >>>>> Label >>>>> TEST >>>>> OnDemand >>>>> >>>>> ProgramArguments >>>>> >>>>> /bin/ls >>>>> >>>>> >>>>> SoftResourceLimits >>>>> >>>>> Core >>>>> 10000000000 >>>>> >>>>> CPU >>>>> 10000000000 >>>>> >>>>> Data >>>>> 10000000000 >>>>> >>>>> FileSize >>>>> 10000000000 >>>>> >>>>> MemoryLock >>>>> 10000000000 >>>>> >>>>> NumberOfFiles >>>>> 8192 >>>>> >>>>> NumberofProcesses >>>>> 150 >>>>> >>>>> ResidentSetSize >>>>> 100000000 >>>>> >>>>> Stack >>>>> 10000 >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Do I at least have the format correct? I couldn't find any >>>>> examples with google to work from. >>>>> >>>>> Cheers, >>>>> >>>>> Greeg >>>>> >>>>> _______________________________________________ >>>>> launchd-dev mailing list >>>>> launchd-dev@lists.macosforge.org >>>>> http://lists.macosforge.org/mailman/listinfo/launchd-dev >>>> >>> >> > From gregdingle at yahoo.com Mon Jul 9 14:32:06 2007 From: gregdingle at yahoo.com (Greg Dingle) Date: Mon Jul 9 14:32:18 2007 Subject: [launchd-dev] resource limits In-Reply-To: <66D414D5-6A9F-438F-AAFB-94F08DF912B1@apple.com> References: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> <3E3B9544-D8D3-4D5A-8AD6-5683C68365ED@yahoo.com> <31182FBA-61EE-4860-A84F-EADA39569C35@apple.com> <66D414D5-6A9F-438F-AAFB-94F08DF912B1@apple.com> Message-ID: <81ACE894-9250-43BB-BC07-BBC1641F2226@yahoo.com> Ok, thanks for the help. On 9-Jul-07, at 1:43 PM, Dave Zarzycki wrote: > Syntactically, what you added to your property list is correct. The > bug in launchd (fixed in Leopard) is difficult to explain. I think > the most pragmatic thing to do on a Tiger based system is to do is > wrap the daemon in a quick shell script and have it adjust the > resource limit you want. For example: > > #!/bin/sh > > ulimit -c 0 > > exec /usr/sbin/serverd > > > > > davez > > > > On Jul 9, 2007, at 1:38 PM, Greg Dingle wrote: > >> No, sorry, can't wait until Leopard. I want to use the resource >> limits for a program currently running on a production server. >> >> What is thing that is easily confused? I have tried both soft/hard >> limits -- that is not what you mean, is it? Is the implementation >> actually broken? I thought somebody here could just clarify the >> form for setting the limits. >> >> Greg >> >> On 9-Jul-07, at 1:28 PM, Dave Zarzycki wrote: >> >>> Sadly, in retrospect, it looks like the soft/hard limit code in >>> Tiger (not Leopard) contains an easily confusable implementation. >>> Can you wait until Leopard? >>> >>> davez >>> >>> >>> On Jul 9, 2007, at 11:00 AM, Greg Dingle wrote: >>> >>>> The build is 10.4.10. >>>> >>>> On 9-Jul-07, at 9:20 AM, Dave Zarzycki wrote: >>>> >>>>> Which build of the OS? >>>>> >>>>> >>>>> On Jul 7, 2007, at 4:16 PM, Greg Dingle wrote: >>>>> >>>>>> Hi, I'm just trying to get the resource limits working with >>>>>> launchd and a plist. Whatever I try I get a segmentation fault. >>>>>> >>>>>> I've tried with an empty dict: >>>>>> >>>>>> >>>>>> >>>>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >>>>>> >>>>>> >>>>>> Label >>>>>> TEST >>>>>> OnDemand >>>>>> >>>>>> ProgramArguments >>>>>> >>>>>> /bin/ls >>>>>> >>>>>> >>>>>> SoftResourceLimits >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> And also with some dummy values: >>>>>> >>>>>> >>>>>> >>>>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >>>>>> >>>>>> >>>>>> Label >>>>>> TEST >>>>>> OnDemand >>>>>> >>>>>> ProgramArguments >>>>>> >>>>>> /bin/ls >>>>>> >>>>>> >>>>>> SoftResourceLimits >>>>>> >>>>>> Core >>>>>> 10000000000 >>>>>> >>>>>> CPU >>>>>> 10000000000 >>>>>> >>>>>> Data >>>>>> 10000000000 >>>>>> >>>>>> FileSize >>>>>> 10000000000 >>>>>> >>>>>> MemoryLock >>>>>> 10000000000 >>>>>> >>>>>> NumberOfFiles >>>>>> 8192 >>>>>> >>>>>> NumberofProcesses >>>>>> 150 >>>>>> >>>>>> ResidentSetSize >>>>>> 100000000 >>>>>> >>>>>> Stack >>>>>> 10000 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Do I at least have the format correct? I couldn't find any >>>>>> examples with google to work from. >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Greeg >>>>>> >>>>>> _______________________________________________ >>>>>> launchd-dev mailing list >>>>>> launchd-dev@lists.macosforge.org >>>>>> http://lists.macosforge.org/mailman/listinfo/launchd-dev >>>>> >>>> >>> >> > From zarzycki at apple.com Wed Jul 18 07:00:05 2007 From: zarzycki at apple.com (Dave Zarzycki) Date: Wed Jul 18 07:00:08 2007 Subject: [launchd-dev] resource limits In-Reply-To: <9E0674F5-54AB-4345-B7FB-D261C45E4499@yahoo.com> References: <2138D2C5-8474-4DE7-80F0-F902E661917A@yahoo.com> <7EAC5164-84C1-4994-BCB9-D4C0586CD480@apple.com> <3E3B9544-D8D3-4D5A-8AD6-5683C68365ED@yahoo.com> <31182FBA-61EE-4860-A84F-EADA39569C35@apple.com> <66D414D5-6A9F-438F-AAFB-94F08DF912B1@apple.com> <9E0674F5-54AB-4345-B7FB-D261C45E4499@yahoo.com> Message-ID: <96A7F2F5-29FE-4BBA-B570-DB573320E52B@apple.com> Not all limits are enforced on Mac OS X at the moment? On Jul 17, 2007, at 3:23 PM, Greg Dingle wrote: > Hi Davez, > > I got around to trying ulimit just now and I got it to work with the > max filesize but not any of the memory options, which is what I > really need. I tried all of: > > ulimit -m 1000 > ulimit -l 1000 > ulimit -v 1000 > > ...then started programs that use more than 1 meg of memory with no > effect. I expected to get an error message or some evidence in top. > Is there something that I should know about ulimit on Mac OS? I > searched google with no success. > > Greg > > On 9-Jul-07, at 1:43 PM, Dave Zarzycki wrote: > >> Syntactically, what you added to your property list is correct. The >> bug in launchd (fixed in Leopard) is difficult to explain. I think >> the most pragmatic thing to do on a Tiger based system is to do is >> wrap the daemon in a quick shell script and have it adjust the >> resource limit you want. For example: >> >> #!/bin/sh >> >> ulimit -c 0 >> >> exec /usr/sbin/serverd >> >> >> >> >> davez >> >> >> >> On Jul 9, 2007, at 1:38 PM, Greg Dingle wrote: >> >>> No, sorry, can't wait until Leopard. I want to use the resource >>> limits for a program currently running on a production server. >>> >>> What is thing that is easily confused? I have tried both soft/hard >>> limits -- that is not what you mean, is it? Is the implementation >>> actually broken? I thought somebody here could just clarify the >>> form for setting the limits. >>> >>> Greg >>> >>> On 9-Jul-07, at 1:28 PM, Dave Zarzycki wrote: >>> >>>> Sadly, in retrospect, it looks like the soft/hard limit code in >>>> Tiger (not Leopard) contains an easily confusable implementation. >>>> Can you wait until Leopard? >>>> >>>> davez >>>> >>>> >>>> On Jul 9, 2007, at 11:00 AM, Greg Dingle wrote: >>>> >>>>> The build is 10.4.10. >>>>> >>>>> On 9-Jul-07, at 9:20 AM, Dave Zarzycki wrote: >>>>> >>>>>> Which build of the OS? >>>>>> >>>>>> >>>>>> On Jul 7, 2007, at 4:16 PM, Greg Dingle wrote: >>>>>> >>>>>>> Hi, I'm just trying to get the resource limits working with >>>>>>> launchd and a plist. Whatever I try I get a segmentation fault. >>>>>>> >>>>>>> I've tried with an empty dict: >>>>>>> >>>>>>> >>>>>>> >>>>>> "> >>>>>>> >>>>>>> >>>>>>> Label >>>>>>> TEST >>>>>>> OnDemand >>>>>>> >>>>>>> ProgramArguments >>>>>>> >>>>>>> /bin/ls >>>>>>> >>>>>>> >>>>>>> SoftResourceLimits >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> And also with some dummy values: >>>>>>> >>>>>>> >>>>>>> >>>>>> "> >>>>>>> >>>>>>> >>>>>>> Label >>>>>>> TEST >>>>>>> OnDemand >>>>>>> >>>>>>> ProgramArguments >>>>>>> >>>>>>> /bin/ls >>>>>>> >>>>>>> >>>>>>> SoftResourceLimits >>>>>>> >>>>>>> Core >>>>>>> 10000000000 >>>>>>> >>>>>>> CPU >>>>>>> 10000000000 >>>>>>> >>>>>>> Data >>>>>>> 10000000000 >>>>>>> >>>>>>> FileSize >>>>>>> 10000000000 >>>>>>> >>>>>>> MemoryLock >>>>>>> 10000000000 >>>>>>> >>>>>>> NumberOfFiles >>>>>>> 8192 >>>>>>> >>>>>>> NumberofProcesses >>>>>>> 150 >>>>>>> >>>>>>> ResidentSetSize >>>>>>> 100000000 >>>>>>> >>>>>>> Stack >>>>>>> 10000 >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Do I at least have the format correct? I couldn't find any >>>>>>> examples with google to work from. >>>>>>> >>>>>>> Cheers, >>>>>>> >>>>>>> Greeg >>>>>>> >>>>>>> _______________________________________________ >>>>>>> launchd-dev mailing list >>>>>>> launchd-dev@lists.macosforge.org >>>>>>> http://lists.macosforge.org/mailman/listinfo/launchd-dev >>>>>> >>>>> >>>> >>> >> >