You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Doug MacEachern <do...@telebusiness.co.nz> on 1998/02/17 05:31:47 UTC

aix + bindprocessor()

There are some folks who seem to think apache and all it's children are
binding to the same processor on an aix box with 4 cpu's.  After reading
the the aix bindprocessor manpage, dropping this bit in http_main.c
should unbind the child from the current cpu and randomly select
another.  Anyone know if there is any truth to this?   Or how to find
out?  The tools to find out what cpu a process is bound to ps,
bindprocessor  (command line tool), of course, don't work on this box.

-Doug

--- src/main/http_main.c.orig   Mon Nov 17 04:43:16 1997
+++ src/main/http_main.c        Tue Feb 17 17:24:22 1998
@@ -3062,6 +3062,14 @@
     }

     if (!pid) {
+#ifdef AIX
+#include <sys/processor.h>
+       int status = bindprocessor(BINDPROCESS, (int)getpid(),
+                                  PROCESSOR_CLASS_ANY);
+       if(status != OK)
+           fprintf(stderr,
+                   "processor unbind failed %d\n", status);
+#endif
        RAISE_SIGSTOP(MAKE_CHILD);
        /* Disable the restart signal handlers and enable the just_die
stuff.
         * Note that since restart() just notes that a restart has been



Re: aix + bindprocessor()

Posted by Doug MacEachern <do...@telebusiness.co.nz>.
It turns out, an aix process does bind to a single cpu.  And, this patch
does unbind children, another cpu chosen somehow at random, and reportedly
improves performance.  How about making it an option via #ifdef UNBIND_CPU
or something like that?

-Doug

Doug MacEachern wrote:

> There are some folks who seem to think apache and all it's children are
> binding to the same processor on an aix box with 4 cpu's.  After reading
> the the aix bindprocessor manpage, dropping this bit in http_main.c
> should unbind the child from the current cpu and randomly select
> another.  Anyone know if there is any truth to this?   Or how to find
> out?  The tools to find out what cpu a process is bound to ps,
> bindprocessor  (command line tool), of course, don't work on this box.
>
> -Doug
>
> --- src/main/http_main.c.orig   Mon Nov 17 04:43:16 1997
> +++ src/main/http_main.c        Tue Feb 17 17:24:22 1998
> @@ -3062,6 +3062,14 @@
>      }
>
>      if (!pid) {
> +#ifdef AIX
> +#include <sys/processor.h>
> +       int status = bindprocessor(BINDPROCESS, (int)getpid(),
> +                                  PROCESSOR_CLASS_ANY);
> +       if(status != OK)
> +           fprintf(stderr,
> +                   "processor unbind failed %d\n", status);
> +#endif
>         RAISE_SIGSTOP(MAKE_CHILD);
>         /* Disable the restart signal handlers and enable the just_die
> stuff.
>          * Note that since restart() just notes that a restart has been