Look at all you wonderful people!

I want to play around with the sleep() function for a cgi script I release, but before I shoot myself in the foot, I have a few questions about it and posibly about how webservers may treat a sleeping process executed via a cgi script.

Is there any limit that can be put on how long a process can sleep before the webserver or perl itself goes "hey you know, this guy aint waking up any time soon, I'm gonna well, kill it before the whole system tweaks out"

I'd hate to have something seem to work, and then wig out halfway through. I don't know enough about configuring perl or Apache to know if something like this can be controlled. My guess is there is. If so, is there a default? Is there a safe way to check?

I'm using this for sending mailing list messages (no no no, I aint no spammer, this thing is used for real things.example -> http://quotes.prolix.nu/mailing_list.html) I'm just using sendmail or .qmail to send the mail messages but guess what? sendmail doesn't like when I , say, send 50,000 messages at once :) (I don't blame it)

So it seems that if I send mailings in batches, say, send 100 messages (sleep() an hour) send another 100 messages (sleep and hour) etc. we got a solution. Or possible even better send 1 message sleep 2 seconds send another message, sleep 2 seconds.

I'm looking into the Bulkmail module, but its possible that people who use this script won't have SMTP access, so I want them to be able to ue something else as a default.

Comments? Ideas?

-justin simoni
!skazat!


In reply to Getting Close and Cuddly with the sleep() function by skazat

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.