Does sleep increase server load?
- From: Jason Carlton <jwcarlton@xxxxxxxxx>
- Date: Thu, 19 Jun 2008 12:47:06 -0700 (PDT)
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
.
- Follow-Ups:
- Re: Does sleep increase server load?
- From: xhoster
- Re: Does sleep increase server load?
- From: Ted Zlatanov
- Re: Does sleep increase server load?
- From: J. Gleixner
- Re: Does sleep increase server load?
- Prev by Date: FAQ 8.1 How do I find out which operating system I'm running under?
- Next by Date: Re: Does sleep increase server load?
- Previous by thread: FAQ 8.1 How do I find out which operating system I'm running under?
- Next by thread: Re: Does sleep increase server load?
- Index(es):
Relevant Pages
|