473,472 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FastCGI - multithreaded application - IIS

1 New Member
I'm trying to find a proper way to connect an own application to IIS over FastCGI.

There's official FastCGI specification and quite old library on fastcgi.com site.
There are also some interesting posts on IIS page in the subject:
http://blogs.iis.net/yaminij/archive/2009/01/08/getting-started-with-writing-a-fastcgi-client-application-fastcgi-test-client.aspx
http://blogs.iis.net/rickjames/archive/2007/02/04/fake-fastcgi-web-server.aspx

Everything looks promising, except connection with IIS over FastCGI assuming multithreaded approach.
There's no problem to handle requests from IIS in app process one by one and lets FastCGI IIS module to spawn new processes if necessary, each handle one request at a time.

Managing processes/threads on fastcgi application side (and not on www server side) gives some additional benefits, some operations (eg. config parsing, decoding licence file, etc...) can be done once and other processes/threads can make use of them.

Going into details ....

Using FastCGI on *nix platform application can handle concurrent requests that way:

socket() / bind() / listen()

// BEGIN thread 1
accept()
// END thread 1

// BEGIN thread 2
accept()
// END thread 2

Unfortunately, using IIS FastCGI module, I can't find proper solution to handle multiple concurrent requests with single process (without spawning new processes by IIS FastCGI module or just to decrease its number).

I can get two things from FastCGI module on application side:
(Let's focus on pipes and leave tcp kind of sockets for a moment...)

1. handle – created using CrateNamedPipe() by IIS FastCGI module
Expand|Select|Wrap|Line Numbers
  1.     HANDLE hPipe;
  2.     hPipe = GetStdHandle( STD_INPUT_HANDLE );
2. name of created pipe
Expand|Select|Wrap|Line Numbers
  1. getenv("_FCGI_X_PIPE_")
What can I do with those things to handle concurrent requests in one application process ?
Is there any way to get more handle points to go into multithreaded application version ?
Is there any other way to play with FastCGI IIS module to handle concurrent requests by one application process ?

Is it possible with IIS FastCGI module at all, to handle multiple requests without spawning new app processes by IIS FastCGI module (or just to decrease number of spawning processes) ?

Can I create a named pipe (multiple handle) on application side and pass its name somehow to the IIS module ?
Can I create a new handle to named pipe with given by _FCGI_X_PIPE_ name on application side ?

I've checked several configuration on *nix environments and each of them can handle requests that way... (one application process can handle concurrent multiple requests so it's not necessary to always spawn new app process to handle concurrent request)
  • Apache + mod_fastcgi (but not mod_fcgi)
  • Nginx
  • lighttpd

Does anyone can point me in to the right direction ?

Any help appreciated.
May 16 '13 #1
0 1343

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: nagaraj_hayyal | last post by:
Hi All, thanks for reading this post. just wanted to know about the ratio of threads and processors. i am working on c++ on AIX5.2 platform. my c++ program are multithreaded programs. ...
3
by: nrhayyal | last post by:
Hi All, thanks for reading this post. just wanted to know about the ratio of threads and processors. i am working on c++ on AIX5.2 platform. my c++ program are multithreaded programs. In a...
1
by: Alex Sidorov | last post by:
I open a file with FileOpen in the main thread, and try to read from it and close in another thread. All filr operations in another thread fail with message "bad file name or number". But they work...
4
by: Richard Bell | last post by:
I'm new to VB.net and have a multithreaded application that needs to display a VB form with a cancel button. The thread that displays the form needs to set a cancel flag if the button is pressed. ...
0
by: Ban Leong | last post by:
Hi all... I am developing a simple program to transfer file from desktop to ppc using OpenNetCF.Desktop.Communication class. I want to show a progress bar indicating the file is being...
2
by: Alan Kemp | last post by:
Hi, I have a problem that is half python, half design. I have a multithreaded network server working, each client request spawns a new thread which deals with that client for as long as it is...
3
by: groups | last post by:
Hi all, I've recently ported a rather large C application to run multithreaded. A few functions have seriously deteriorated in performance, in particular when accessing a rather large global...
0
by: batista | last post by:
Hello all, Let me first explain my windows application.... I have a grid which is bound to a dataview of a dataset... Now this dataset is updated from a separate thread and therefore I've...
1
by: Mitch Wardrop | last post by:
ok here it goes I must be doing something way off but it makes sense to me just not to VB.NET which would be a huge problem. Anyways I'll explain what I am doing than give code examples. basicly...
1
by: hadimani | last post by:
how to check the robustness of an event driven multithreaded application that runs as windows service without any user interface?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.