Re: Fastcgi in ocamlnet
Eric Stokes <[email protected]> Fri, 2 Dec 2005 12:53:24 -0800
| Newsgroups | gmane.comp.lang.ocaml.lib.net.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello, I have found the problem. The fix is in CVS, and we will try to either release a new version, or put a patch in godi very soon (this will be up to Gerd to decide). If you are interested, the problem is that the fastcgi protocol has a size limit on packets coming from stdout and stderr (very normal for such a protocol) which happens to be 64Kbytes. Since the buffering system commits it's output all in one shot, and the fastcgi_out_channel class did not properly split it up this limit was violated on your web page. I have fixed that class to properly split up the output and send it in multiple pieces if necessary. Your only limit now should be the size of ocaml strings (which scales with word size), though I have only tested with pages up to 2Mbytes (which should be enough to kill just about any browser around, it certainly killed safari). On Nov 14, 2005, at 4:11 PM, Rouaix, Francois wrote: > Eric, > I got my fastcgi code to work, but I'm getting the exception > Netcgi.std_activation: unexpected output state > when I'm writing "large" output from the fast-cgi server (dynamic > server at this time). I'm writing using cgi#output#output_string, > not in one big write but in a bunch of small writes; it shouldn't > matter anyway since I use the buffered_transactional_optype mode. > > Experimentally, the limit seems to be at around 64kbytes, although > not exactly at 65536. I get a good page at 65566 bytes, but an > exception at a page that would be about 65576 byes. > Is this a known bug, or an expected behavior? Any workaround you > know about? > Thanks > --f > > -----Original Message----- > From: Eric Stokes [mailto:[email protected]] > Sent: Thursday, November 10, 2005 1:05 PM > To: Rouaix, Francois > Subject: Re: Fastcgi in ocamlnet > > Yes, I'll give it a try. We're still running apache 1.3 here, however > I have done this on 2.0 and I remember it being the same (but it was > a while ago when I was trying out suse linux). > > Here is an example directory directive, and some associated server > directives for static servers > > <Directory "/Users/eric/Sites/"> > Options Indexes MultiViews ExecCGI > AllowOverride None > Order allow,deny > Allow from all > AddHandler fastcgi-script .fcgi > AddHandler cgi-script .cgi > </Directory> > > FastCGIServer /Users/eric/Sites/ml_portalep/index.fcgi > FastCGIServer /Users/eric/Sites/change_password/index.fcgi > > The main components are the ExecCGI option must be on, and the > AddHandler fastcgi-script to whatever file extensions you want to use > for fastcgi programs. > > The FastCGIServer directives are not strictly required, anything in > the directory with the .fcgi extension will function as a fastcgi > dynamic server even if it does not have a static configuration. The > difference between dynamic and static servers in mod_fastcgi is best > described here http://www.fastcgi.com/mod_fastcgi/docs/ > mod_fastcgi.html which I have found to be an excellent document. > > Good luck, and let us (Gerd or I) know if you have any problems with > ocamlnet > > On Nov 10, 2005, at 11:18 AM, Rouaix, Francois wrote: > >> Eric, >> If I read correctly some recent emails in the Caml List, you wrote >> the fastcgi support in ocamlnet. Could you mail me the few >> httpd.conf lines that would allow me to test the example provided >> in examples/fcgi/add_fastcgi.fcgi with an Apache 2.0 with >> mod_fastcgi.so loaded? I have zero experience in Fastcgi, and the >> stuff I find here is extremely company specific... >> Thanks >> --f >> ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click