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

silvioprog silvioprog at gmail.com
Fri Jan 30 16:56:36 CET 2015


On Fri, Jan 30, 2015 at 4:46 AM, Michael Van Canneyt <michael at freepascal.org
> wrote:
>
> On Thu, 29 Jan 2015, silvioprog wrote:
>
>> Hello,
>>
>> Using the TCustomHTTPApplication class, I just set the "Threaded"
>> property to true, and my application works in threaded mode. But,
>> how to do the same in TCustomFCgiApplication class?
>>
>
> This is currently not supported.
>
> If you use fastcgi in classical environment, the Apache webserver will
> start as many instances of the fastcgi executable as it considers necessary
> to handle the load.
>
> 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.
>

Perfect.

Do you know if FastCGI proxy accepts a multi-thread structure? I got this
question after I did a test on nginx and Apache. I put a processing in a
thread, and even then the server was waiting for the end of the first
processing. =/

It's interesting we check it, because if they do not support multi-threaded
implementations, we would have unnecessary work.

To support threading requires a major rework of the fastcgi implementation,
> and probably also changes to fpweb (which is not thread-safe).
>
> This is on my todo list, but you are free to try and supply a patch.
>
> Michael.


I'll test my drafts this weekend. I'm very interested in this feature, so
now it is priority in my test list. =)

-- 
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/4f70bc97/attachment.html>


More information about the fpc-pascal mailing list