[systemd-devel] FW: pthread_create() fails SysV in myDaemon on boot

Michael D. Berger m.d.berger at ieee.org
Thu Nov 3 16:27:02 PDT 2011


> -----Original Message-----
> From: Lennart Poettering [mailto:lennart at poettering.net] 
> Sent: Thursday, November 03, 2011 18:08
> To: Michael D. Berger
> Cc: 'Kay Sievers'; systemd-devel at lists.freedesktop.org
> Subject: Re: [systemd-devel] FW: pthread_create() fails SysV 
> in myDaemon on boot
> 
> On Thu, 03.11.11 15:37, Michael D. Berger (m.d.berger at ieee.org) wrote:
> 
> > 
[...]
> So, you basically have three options here:
> 
> a) Opt out of the "cpu" cgroup controller entirely, by 
> dropping it from DefaultControllers in /etc/systemd/system.conf.
> 
> b) Explicitly place your service in the root cgroup of the "cpu"
> controller, by adding "ControlGroup=cpu:/" to the service file.
> 
> c) By actually assigning an RT budget to the group, by adding 
> "ControlGroupAttribute=cpu.rt_runtime_us 500000" to the service file.
> 
> Background: we place every service on the system in its own 
> cgroup in the "cpu" hierarchy. Unfortunately this means that 
> processes which do RT will break, since creating a cgroup in 
> the "cpu" hierarchy will assign them a zero RT budget by 
> default. This needs to be fixed in the kernel one day. With 
> option a) you globally disable that your services get their 
> own "cpu" cgroup. With option b) you do this only for the 
> service in question. With c) you assign an explicit RT budget.
> 
> Why do we add all services to their own "cpu" cgroups? 
> because it evens out CPU usage of services with many and with 
> few processes. Consider Apache with a 1000 worker processes 
> and CGI scripts forked off vs. MySQL with 1 process. 
> Normally, Apache would get 1000 as much CPU as MySQL. By 
> adding them to their own cgroups Apache will get half and 
> MySQL the other half of the available CPU time.
> 
> Lennart
> 
> --
> Lennart Poettering - Red Hat, Inc.
> 
> __________ NOD32 6599 (20111103) Information __________
> 
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
> 
>

Which service file?  If you mean "myDaemon.service", I don't
have one; I have "/etc/init.d/myDaemon".  Could I put
options b) or c) in "/etc/init.d/myDaemon"? (I tried it, and
I didn't start on boot.  But maybe my format was wrong.)

In "ControlGroupAttribute" described in any man page?

Is it necessary for me to create a "myDaemon.service" file?
If so, in what directory should I put it?

Note that I also am failing to bind a TCP listener socket.

Thanks for your help.
Mike.
--
Michael D. Berger
m.d.berger at ieee.org
http://www.rosemike.net/
  
 



More information about the systemd-devel mailing list