Why your redirectors are using that much CPU I do not know, but for it
to work you need to disable STDIO buffering.
In main, call
setvbuf(stdout, NULL);
If still having problems, try attaching a debugger to one of your helper
processes to se what it is doing.
--
Henrik Nordstrom
Squid Hacker
Jens-Peter wrote:
>
> Hi all!
>
>
>
> We have written a small C program that works as a redirector for Squid
> 2.3 Stable 1.
>
>
>
> The C program seems to work ok. I basically looks like this:
>
>
>
>
>
> void die(int x) {
>
> quitflag=1;
>
> exit(0);
>
> }
>
>
>
> int main(int argc, char **argv) {
>
> /* Set up signal handlers to quit correctly */
>
> signal(SIGPIPE, die);
>
> signal(SIGHUP, die);
>
>
>
> while (!quitflag) {
>
> fgets(st,1024, stdin);
>
> if (quitflag) exit(0);
>
> /* handle requests */
>
> }
>
> return 0;
>
> }
>
>
>
> Squid is configured to start 10 redirectors at a time.
>
> The problem is, that I often discover 10 redirectors using approx 10%
> CPU each. This makes the proxy very slow, and I guess that the
> redirectors are really just looping. What has happened here? Did Squid
> in someway try to shut down the redirectors with another signal?
>
>
>
> Any clues would be appreciated!
>
>
>
> Best regards,
>
>
>
> Jens-Peter Vraa Jensen
Received on Tue Jun 19 2001 - 10:28:38 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:04 MST