OK so I rewrote the pipe reader to ignore end of file
marker and just keep reading. The stability of squid
(writing to the pipe) and my reader seems much, much better
I also use nohup(1) but most of the time it seems
unnecessary.
I had a go at daemonizing the reader in the process of
getting it more stable but none of the statements after the
fork got executed. I can't understand why my test program
worked but this one didn't. The fork() seemed to work
ok.
Anyway I have left that to move onto more pressing
matter: Performance. The system is a proxy which
tracks downloads making people pay per megabyte. When they
run out of credit they can't download. As a sideline the
system does censorship[1] of www content. Now the problem
is that when losts of people start browsing the web the
load avg goes to ~20 and
everything slows to a crawl. The Mysql daemon chews lots of
CPU. So I am working on caching the information and making
sure that the tables are designed properly with proper
indexes and keys.
Can someone please certify me :-) I am slightly more
then an observer but just less then an apprentice
[1] I know, I know. You hate censorship. So do I! But I have a legal responsiblity to sheild minors using my system from that which is deemed socially acceptable as best as possible.