Re: Make apache sleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Another idea in the same direction:

Use a RewriteMap on every request and have the
rewrite map do something ressuorce intensive.

...

<VirtualHost *:80>
    RewriteEngine On
    RewriteMap    mymap       prg:/tmp/tmp.pl

    RewriteRule ^/(.*) ${mymap:$1}


And the map /tmp/tmp.pl:
	
#!/usr/bin/perl -w

use strict;

#   disable buffered I/O which would lead
#   to deadloops for the Apache server
$| = 1;

while (<>) {
	sleep 5; # FIXME: Find something ressource-intensive here
	print "\n";
}


Mod_rewrite is fairly early in the request lifecycle.
So I am using it quite often in such a way when running
tests. (Mostly timing issues, where sleep is good enough)

just another 2 cents worth of info.

Christian



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux