Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

My generall question is as follows (and I will describe my situation in more detail later)"

I am trying to figure out if it is possible to configure Apache2 in a way that will allow for me to programatically control the order of which children recieve requests. For example:

  • I have 10 idle children
  • I have 10 separate requests come in, separated each by one second (for arguments sake)
  • I want to *ensure* the order of the requests is handled by child 1, then 2, 3, ... 10 in that specific order.

    From my current understanding, this isn't really possible. Being that each of the children sit on sockets in a queue, it will most likely be up to the OS' Kernel (in a Linux/prefork environment) to determine who gets what when. However, I wanted to see if any of you wise'ns might be able to tell me differently.

    Essentailly, I don't like children getting over used. I am observing that a child will be granted the request, generally speaking, if it is idle. Therefore, given quick response times, the first child in a FIFO queue would get way more traffic than the (in my example) 10th child. I was hoping I could get around that.

    Any thoughts?

    Thanks in advance for any comments/posts!!

    2006-03-24 Retitled by planetscape, as per Monastery guidelines
    Original title: 'Configuring Apache child distribution'

    • Comment on (OT) Configuring Apache child distribution
  • Replies are listed 'Best First'.
    Re: (OT) Configuring Apache child distribution
    by perrin (Chancellor) on Mar 24, 2006 at 18:49 UTC
      Essentailly, I don't like children getting over used.

      In this context, you should. The FIFO behavior is highly desirable for mod_perl. The more it reuses the same child processes, the fewer processes need to be run, and that saves you RAM.

      Maybe you were thinking that a process might be handling more than one request at once? That never happens. A process will only accept a new request when the previous one is completely finished.

    Re: (OT) Configuring Apache child distribution
    by shotgunefx (Parson) on Mar 24, 2006 at 08:56 UTC
      Don't think it's doable (but most of my experience is with 1.3 series).

      But I've got to ask, why would you care? Is there something I'm missing or is it just to do it? It's not like it's going to wear out ;)

      -Lee
      "To be civilized is to deny one's nature."