[CS-FSLUG] FastCGI

Micah Yoder micah at yoderdev.com
Mon Apr 12 08:20:00 CDT 2021


Yeah I would think you wouldn't call exit().  That would cause the 
process to die and it would need to be forked again, being nearly as 
inefficient as traditional CGI.

It sounds like your application might need to be redesigned a bit if 
calling exit() or using a goto is deemed a necessity. In Python/WSGI a 
request just triggers a function call, which exits normally. Anything 
more complex than that would seem awkward.

On 4/11/21 5:50 PM, Timothy Butler wrote:
> Thanks, Micah. That’s what I was thinking. There’s apparently 
> something like Python’s WSGI called PSGI, but so far I’ve found it 
> easier to figure out how to implement FastCGI — it’s dead simple so far.
>
> One thing I’ve found conflicting info on that maybe you have a thought 
> on, since it applies across languages, I believe: some people say you 
> should never call exit() on a script being run through FastCGI. Others 
> say it doesn’t matter. My code uses exit in a lot of places where it 
> is important to make sure nothing keeps executing, but there’s not a 
> fatal error. I’ve mostly used it so that I don’t accidentally overlook 
> something continuing on and cause a security hole. However, I’m 
> wondering if I need to remove those calls.
>
> I found one suggestion of using GOTO (which I’ve not used since I 
> played with Basic so many years ago) to go to an empty block of code 
> beyond all the other code as a replacement to exit().
>
> Any thoughts?
>
> Tim
>
>
> *Timothy R. Butler*, M.Div
> Editor-in-Chief, /Open for Business/ <https://ofb.biz>
> tbutler at ofb.biz <mailto:tbutler at ofb.biz>
>
>> On Apr 11, 2021, at 5:35 PM, Micah Yoder <micah at yoderdev.com 
>> <mailto:micah at yoderdev.com>> wrote:
>>
>> No recent Perl experience, but I do know that php-fpm (the FastCGI 
>> version of PHP) is vastly preferable to mod_php for several reasons.
>>
>> Python applications commonly use WSGI, which is its own protocol but 
>> similar.
>>
>> Basically IMHO that or something like it is the only sane way to run 
>> web applications. Old-school CGI should pretty much never be used, 
>> and bundling the language in the web server (mod_*) is a bad idea too.
>>
>> On 4/11/21 5:21 PM, Timothy Butler wrote:
>>> Hey, everyone,
>>> Does anyone on here have insight into using FastCGI to speed up Perl 
>>> execution? I’ve been playing with it the last week and I am amazed 
>>> at the results, but FastCGI seems to be mostly dormant. My CMS goes 
>>> from taking around 600ms to fulfill a request to as low as 180ms 
>>> (all but as fast as a static page). So far as I can tell, it has 
>>> several advantages over mod_perl, most importantly that it works 
>>> with Suexec to keep scripts from running with privileges beyond the 
>>> current site’s own.
>>>
>>> On the other hand, the FCGI module for Perl seems to have broken 
>>> UTF-8 support, which is a pretty nasty thing in 2021.
>>>
>>> Thoughts?
>>>
>>> Tim
>>>
>>>
>>> *Timothy Butler*
>>> tbutler at ofb.biz <mailto:tbutler at ofb.biz>
>>>
>>> /"The best theology would need no advocates: it would prove 
>>> itself."/ —Karl Barth
>>>
>>>
>>> _______________________________________________
>>> ChristianSource FSLUG mailing list
>>> Christiansource at ofb.biz
>>> http://cs.uninetsolutions.com
>> _______________________________________________
>> ChristianSource FSLUG mailing list
>> Christiansource at ofb.biz <mailto:Christiansource at ofb.biz>
>> http://cs.uninetsolutions.com
>
>
> _______________________________________________
> ChristianSource FSLUG mailing list
> Christiansource at ofb.biz
> http://cs.uninetsolutions.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ofb.biz/pipermail/christiansource_ofb.biz/attachments/20210412/b17f0cb2/attachment.htm>


More information about the Christiansource mailing list