[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] acgi vs cgi



Richard Rathe writes:
|Since printing the response HTML page is often the last thing my CGIs do,
|ACGI really has no advantage as far as I can tell.

ACGIs aren't meant to speed up the CGI. That is, if you submit a single
request to the server and a CGI is needed, whether a CGI or ACGI is used
won't make any difference (assuming everything else being equal).

However, what an ACGI does is allow the server to do other things while
the CGI is running. Consider what happens when user 1 does something
requiring a CGI (submits a form, say), then user 2 requests a static
HTML page. If the form CGI is a CGI (as opposed to an ACGI), the server
has to wait for the CGI to finish before serving user 2's page. If the
form CGI is an ACGI, the server can serve user 2's page as soon as it
has fired off the ACGI. This would mean the ACGI will take a bit longer
to run, and the page will be served a bit slower than if it was the
only request, but the page will be served faster (potentially a lot
faster if the CGI/ACGI takes a while to run).

You can also run multiple ACGIs at the same time, although if they're
MacPerl scripts, the requests will be queued (I assume), because MacPerl
can only run one script at once. However, if you move your script to
Unix (or Rhapsody, presumably), the server may run multiple instances of
it at the same time. This means if you use an ACGI, you need to think
about what happens if multiple copies of your script are running at the
same time.

Brian

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch