Want to use Apache 1.3.27 with xinetd to set nice value on start?

michaelsanford

Translator, Web Developer
Application: I want to start apache threads with a nice value of, say, +5 to ease up on my system a bit.

So far, all I know to do is to set httpd.conf's ServerType directive to "inetd". I don't know how to create an appropriate /etc/xinetd.d/http entry to start apache properly.

I'm doing an overhaul of all my online services, so if you think that doing this will result in a negligible performance increase, please say so. I've not known apache to be a really power-hungry application. As for my users and potentially slower page loads, I couldn't care less.

PS I'm doing the same with FTP, can I just prepend "nice +5" to my server = /usr/libexec/ftpd" line in xinetd.d/ftp ?

Ideas?
 
You could leave it as standalone, and edit the startup item script that starts up httpd.

Just need to change it from saying apachectl start to nice +5 /usr/sbin/httpd, and it should start up fine.

Just like to say that I haven't tried that at all, but it should work. ;)
 
Oops, sorry didn't see you posted back.

/System/Library/StartupItems/Apache/Apache is the startup script.

Obviously, you'll need root perms to edit it. ;)
 
Oh! For some reason I keep ruling out those Apple startup items scripts and keep looking in /etc/rc* even though I know those aren't the ones heh.

Woohoo now I can modify everything, thanks DarkShadow!
 
oops:

Code:
StartService ()
{
    if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then
        ConsoleMessage "Starting Apache web server"
        apachectl start
    fi
}

It looks like I won't be able to nice this, because it would just nice apachectl, but not httpd :p

Any other ideas?
 
WOAH sorry I'm really spaced out (all the Tylenol 3s I've been prescribed).

Will doing this maintain the httpd.conf directives for spareservers and all that stuff, since it looks like we're just manually starting a single server thread?
 
Yeppers, your configuration shouldn't be changed at all. This will be considered the initial server, just as if you had issued apachectl start. :)
 
Back
Top