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



## michaelsanford (Nov 1, 2003)

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?


----------



## Darkshadow (Nov 1, 2003)

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.


----------



## michaelsanford (Nov 1, 2003)

Thanks DarkShadow, just one question, where does that startup script exist?


----------



## Darkshadow (Nov 1, 2003)

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.


----------



## michaelsanford (Nov 2, 2003)

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!


----------



## michaelsanford (Nov 2, 2003)

oops:


```
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 

Any other ideas?


----------



## Darkshadow (Nov 2, 2003)

That's why I said to replace apachectl start with nice +5 /usr/sbin/httpd.


----------



## michaelsanford (Nov 2, 2003)

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?


----------



## Darkshadow (Nov 2, 2003)

Yeppers, your configuration shouldn't be changed at all.  This will be considered the initial server, just as if you had issued apachectl start.


----------

