[fpc-pascal] How to use FCGI in threaded mode?

silvioprog silvioprog at gmail.com
Fri Jan 30 17:02:31 CET 2015


On Fri, Jan 30, 2015 at 8:57 AM, Michael Van Canneyt <michael at freepascal.org
> wrote:
>
> On Fri, 30 Jan 2015, Michael Schnell wrote:
>
>> On 01/30/2015 08:46 AM, Michael Van Canneyt wrote:
>>
>>>
>>> Only if you use proxy fastcgi (i.e. a separately running binary
>>> listening on a fixed port, not started in Apache), then threading may be
>>> useful.
>>>
>>>  Am I wrong thinking, that using "proxy FCGI" projects are a lot easier
>> to manage, anyway, as here you can use normal debugging means (e.g.
>> Lazarus) ?
>>
>
> Not really. On windows they must be service programs, which are an
> absolute horror to debug.
>
>  And with a permanently running  independent executable, you also can do a
>> lot of stuff that might be difficult to accomplish with a program started
>> and killed by the Server.
>>
>
> Well, I switched from proxy fcgi to normal fastcgi for performance reasons.
> It simply scales better.
>

I think you should test your fcgi as proxy again after we implement the
multi-thread support.

A tool as AB, that simulate multiple requests per second, it will have a
low performance in in currenty implementation of proxy fcgi, because when
AB call a second request, for example, the first probably will be still
processing, since the interval between requests in AB is too short.


> With all the virtualization happening these days, introducing state on the
> server is a very bad idea anyway, so I would not recommend this approach.
>
> As for debugging: it rarely happens that I must debug an actual running
> fastcgi program.
> All code is unit tested, and the unit tests run in a CLI program.
>
> The nice thing of web is that it is simply "text in, text out". Can
> perfectly be simulated on the command-line.


-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150130/25bbf1c0/attachment.html>


More information about the fpc-pascal mailing list