PEP 594 cgi & cgitb removal
Peter J. Holzer
hjp-python at hjp.at
Sat Jun 1 13:55:31 EDT 2019
On 2019-05-25 23:45:06 +0200, Roel Schroeven wrote:
> Jon Ribbens via Python-list schreef op 25/05/2019 om 21:00:
> > On 2019-05-25, Michael Torrie <torriem at gmail.com> wrote:
> > > On 05/24/2019 04:27 AM, Jon Ribbens via Python-list wrote:
> > > > Sorry, in what sense do you mean "Serverless is CGI"?
> > > >
> > > > As far as I can tell, it's just a script to automatically upload
> > > > bits of code into various cloud providers, none of which use CGI.
> > >
> > > Not really. Serverless just means stateless web-based remote procedure
> > > calls. This is by definition what CGI is.
> >
> > No, it isn't. CGI is a specific API and method of calling a program
> > in order to serve a web request. It isn't a shorthand for "any
> > web-based remote procedure call".
>
> More specifically, with CGI the webserver starts a new process for every
> single request. That's bad enough for a light C program, but it's certainly
> not a good idea to start a whole new Python process for every request. At
> least not for any production website or web service that serves any real
> amount of traffic.
I strongly disagree with this. A minimal Python script using the cgi
package takes between 50 and 80 milliseconds on my (not very fast)
private server. Assuming a script which does anything useful takes about
100 milliseconds, that's still
a) a shorter response time than a lot of websites with persistent
servers have
b) fast enough not be a bottleneck on the vast majority of web sites.
Yes, you cannot run Facebook on CGI, but most websites aren't
Facebook. I doubt we have even one website which gets close to 10
requests to dynamic content per second. Much less 10 requests per
second per core.
I don't use CGI very much these days (and when I do, I use Perl - old
habits die hard), but performance isn't the reason.
hp
--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp at hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20190601/78c3c2c7/attachment.sig>
More information about the Python-list
mailing list