[Koha-devel] Apache directive TimeOut works differently when using mod_cgi (CGI) vs mod_proxy_http (Plack)

dcook at prosentient.com.au dcook at prosentient.com.au
Fri Sep 4 04:37:45 CEST 2020


Hi all,

 

While troubleshooting Apache TimeOut for Plack vs CGI
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26128), I
discovered that Apache seems to respect TimeOut when measuring a timeout
proxying requests to Plack. However, it actually *doubles* the time when
running CGI scripts on its own.

 

I've looked through the Apache httpd and apr source code, and it's not
obvious to me at a glance why this happens, but I think it's important for
us to realize this, because it means the solution presented by "Make
processes that rely on background jobs run in CGI mode"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15218 might not
always be necessary. Based on my investigation, it seems the reason some
scripts work in CGI but not in Plack is simply because of the different way
timeouts occur. If we just raise the ProxyTimeout to twice the value of
TimeOut (ie change it to 600 to be 2*TimeOut), then we'll be getting the
same behaviour. 

 

Of course, the real solution in these cases is still to use asynchronous
processing via "Add a task queue"
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22417). 

 

In any case, I thought it was important to share my findings, because it
means we might actually be able to reduce our dependency on CGI now even
before Bug 22417 is pushed. 

 

Thank you,

 

David Cook

Software Engineer

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20200904/9428bcdb/attachment-0001.htm>


More information about the Koha-devel mailing list