I've been working on a server based on the pre-forking server in recipe 17.12. I've come across a problem for which I'm having trouble seeing a solution.

The server is sent client requests through a web-browser. That part works perfectly. What I need to be able to do is send the server a client request to kill another process.

What's the problem? Well, if I allow a maximum of 5 processes to be forked at a time, and all 5 are busy processng requests, then the request to kill will be waiting in the queue and not killing the process immediately. If there was a guarantee that the processes would end quickly, this wouldn't be an issue, but the server handles requests that can take hours to complete. Waiting several hours for a kill request to be processed just isn't good enough.

I can't kill the process direct from the web-page, as I found out in another node.

I know I could just write another program owned by root which could kill the processes, but I, and The Guy Who Reviews My Code agree that it would not be the most elegant solution.

I, gentle monks, am stuck. I've been wracking my brain all day and I can not see a solution. Perhaps I am too close to the problem. I throw myself on the mercy of the Monastery. Help a fellow monk in need!

-burntflowers


In reply to Kill Processes on Pre-Forking Servers by aijin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.