25 Aug 2008 23:37
SCGI proof-of-concept implementation
Michel Lespinasse <walken <at> zoy.org>
2008-08-25 21:37:18 GMT
2008-08-25 21:37:18 GMT
Hi, I've been looking at the scgi protocol and found it really easy to implement. Would there be any interest in this ? and if so, is it too late to make it into mathopd-1.6 already ? Attached is a small proof-of-concept patch to start up the discussion. I'm not sure if majordomo likes attachments, so if it gets eaten please get it at http://www.lespinasse.org/mathopd-scgi.diff instead. The idea is this: * process_cgi was renamed into process_cgi_scgi. It builds the CGI environment as before, then calls either process_cgi or process_scgi. * process_cgi forkexecs the CGI script. The master process keeps a socketpair to talk with it. * process_scgi connects to an existing SCGI unix socket socket, and the master process keeps that socket to talk with it. The client_input pool is prefilled with the CGI environment variables converted to SCGI format. * calling writetochild directly at the end of process_scgi is not necessary for correctness, but I found out that it made a large difference (35%) in performance when the SCGI serves small (3KB) cached replies. I have a few questions about how to go further: Currently, my patch uses the following configuration item: Specials { SCGI { .scgi }} The .scgi file must exist, but it can't be the unix socket for the scgi process - otherwise, get_path_info() complains that it cannot openit. I have not found a nice workaround for this yet, so I just use a hardcoded(Continue reading)
RSS Feed