Does sleep increase server load?



I'm pretty sure that this is a basic question, but I simply don't know
the answer. Does the sleep command increase the server load at all
while running?

The reason I ask, I have a contact form that spam robots typically try
to use to send junk. I have some very basic filters in place that
catch 99.9% of it, which is great, but the robots still waste my
server resources in trying to utilize it. So, I was thinking of
dropping them into a loop; something along the lines of:

if ($spam_criteria eq "true") {
while (1 > 0) {
sleep 200;
}
}

else {
# send email
}

I know that the while statement would use a little of the resources,
but if sleep doesn't then the sleep 200 would at least give the server
a break in between. And when the robots attack, it's usually at a rate
of 5 or 10 per second, so this is significantly better.

But, of course, it only works if sleep 200 doesn't increase the server
load!

TIA,

Jason
.



Relevant Pages

  • Re: Does sleep increase server load?
    ... JC> I'm pretty sure that this is a basic question, ... Does the sleep command increase the server load at all ... it just puts the calling process to sleep. ... I have a contact form that spam robots typically try ...
    (comp.lang.perl.misc)
  • Re: context switch
    ... I wrote 2 version, one version still uses sync I/O, one server thread per ... and use same thread write back to client. ... sleep back to client programs. ... server CPU cost up to 98 too. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: context switch
    ... I wrote 2 version, one version still uses sync I/O, one server thread per ... and use same thread write back to client. ... sleep back to client programs. ... server CPU cost up to 98 too. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Does sleep increase server load?
    ... Does the sleep command increase the server load at all ... I have a contact form that spam robots typically try ...
    (comp.lang.perl.misc)
  • RE: Windows 2003 Server MACVOL disconnect error
    ... Slect "sleep" tab ... Under Wake Options, ... '--'We have a Windows 2003 Server with a MACVOL configured to store files for 8 ... '--'because data is typically not lost when the disconnect occurs, ...
    (microsoft.public.windows.server.networking)