On Mon, Jul 28, 2003 at 04:27:15PM +0100, Brian Candler wrote:
> My proposed patch is below. The fundamental premise is that catch_sig should
> exit immediately after cleaning up, rather than returning to the main loop,
> and that SIG_PIPE should be ignored when running as fastcgi.

Well it kind-of works, but now I find that sqwebmail leaks memory. From an
initial footprint of about 1.5MB it grows; 32MB is the biggest I've seen.

exim  13022  0.0 12.5 32652 32156  ??  S     8:17AM   3:07.87 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  17045  0.1 10.2 26932 26432  ??  S     9:09AM   2:23.22 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31182  0.0  0.7  2316 1792  ??  S    11:47AM   0:04.81 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31188  0.0  0.6  2168 1644  ??  S    11:47AM   0:04.89 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31234  0.0  1.7  4980 4460  ??  S    11:48AM   0:11.53 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31239  0.0  0.6  2104 1580  ??  S    11:48AM   0:04.18 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31240  0.0  2.3  6484 5964  ??  S    11:48AM   0:18.94 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31242  0.0  0.7  2272 1748  ??  S    11:48AM   0:12.27 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31246  0.0  1.7  4784 4264  ??  S    11:48AM   0:11.67 
/usr/local/sqwebmail/cgi-bin/sqwebmail
exim  31247  0.0  0.6  2112 1588  ??  S    11:48AM   0:03.38 
/usr/local/sqwebmail/cgi-bin/sqwebmail

It's not clear to me whether the process eventually dies because of an error,
or because of mod_fastcgi's dynamic pool sizing which will eventually
terminate idle children until there's only one left, or a combination of
these.

Attached below are some relevant-looking entries from my Apache error log.

For now I think I will revert to running under normal CGI environment rather
than fastcgi. It means an extra fork/exec but since sqwebmail has such a low
startup overhead I don't think it makes all that much difference.

Cheers,

Brian.

[Tue Jul 29 00:19:11 2003] [error] [client x.x.x.x] (32)Broken pipe: FastCGI: comm 
with server "/usr/local/sqwebmail/cgi-bin/sqwebmail" aborted: write failed
[Tue Jul 29 00:19:12 2003] [error] [client x.x.x.x] FastCGI: incomplete headers (0 
bytes) received from server "/usr/local/sqwebmail/cgi-bin/sqwebmail"
[Tue Jul 29 03:35:07 2003] [error] [client x.x.x.x] (32)Broken pipe: FastCGI: comm 
with server "/usr/local/sqwebmail/cgi-bin/sqwebmail" aborted: write failed
[Tue Jul 29 03:37:39 2003] [error] [client x.x.x.x] FastCGI: incomplete headers (0 
bytes) received from server "/usr/local/sqwebmail/cgi-bin/sqwebmail"
[Tue Jul 29 03:52:07 2003] [warn] FastCGI: (dynamic) server 
"/usr/local/sqwebmail/cgi-bin/sqwebmail" (pid 82388) terminated due to uncaught signal 
'10' (Bus error)
[Tue Jul 29 07:15:10 2003] [warn] FastCGI: (dynamic) server 
"/usr/local/sqwebmail/cgi-bin/sqwebmail" restarted (pid 8955)
[Tue Jul 29 08:16:59 2003] [warn] FastCGI: (dynamic) server 
"/usr/local/sqwebmail/cgi-bin/sqwebmail" (pid 82377) terminated due to uncaught signal 
'10' (Bus error)
[Tue Jul 29 08:17:02 2003] [warn] FastCGI: (dynamic) server 
"/usr/local/sqwebmail/cgi-bin/sqwebmail" has remained running for more than 30 
seconds, its restart interval has been restored to 5 seconds
[Tue Jul 29 08:17:02 2003] [warn] FastCGI: (dynamic) server 
"/usr/local/sqwebmail/cgi-bin/sqwebmail" restarted (pid 13022)
[Tue Jul 29 08:20:07 2003] [warn] FastCGI: (dynamic) server 
"/usr/local/sqwebmail/cgi-bin/sqwebmail" (pid 8955) terminated due to uncaught signal 
'10' (Bus error)
[Tue Jul 29 08:20:10 2003] [warn] FastCGI: (dynamic) server 
"/usr/local/sqwebmail/cgi-bin/sqwebmail" restarted (pid 13527)
[Tue Jul 29 08:43:45 2003] [error] [client x.x.x.x] FastCGI: comm with (dynamic) 
server "/usr/local/sqwebmail/cgi-bin/sqwebmail" aborted: (first read) idle timeout (30 
sec)
[Tue Jul 29 08:43:45 2003] [error] [client x.x.x.x] FastCGI: incomplete headers (0 
bytes) received from server "/usr/local/sqwebmail/cgi-bin/sqwebmail"
[Tue Jul 29 08:43:50 2003] [error] [client x.x.x.x] FastCGI: comm with (dynamic) 
server "/usr/local/sqwebmail/cgi-bin/sqwebmail" aborted: (first read) idle timeout (30 
sec)
[Tue Jul 29 08:43:50 2003] [error] [client x.x.x.x] FastCGI: incomplete headers (0 
bytes) received from server "/usr/local/sqwebmail/cgi-bin/sqwebmail"
[Tue Jul 29 08:43:52 2003] [error] [client x.x.x.x] FastCGI: comm with (dynamic) 
server "/usr/local/sqwebmail/cgi-bin/sqwebmail" aborted: (first read) idle timeout (30 
sec)
[Tue Jul 29 08:43:52 2003] [error] [client x.x.x.x] FastCGI: incomplete headers (0 
bytes) received from server "/usr/local/sqwebmail/cgi-bin/sqwebmail"
[Tue Jul 29 08:43:54 2003] [error] [client x.x.x.x] FastCGI: comm with (dynamic) 
server "/usr/local/sqwebmail/cgi-bin/sqwebmail" aborted: (first read) idle timeout (30 
sec)

Reply via email to