Solved

Disable output buffering in IIS8 for CGI exe file output

Posted on 2016-08-20
5
43 Views
Last Modified: 2016-08-22
I've got an EXE program that is executed by IIS8 (on Win2012 server) using CGI, to generate an html page.
Now I want this output not to be buffered by IIS, as it takes some time to generate the output and the end user should need to wait for the first lines to appear

The application flushes output and al, but IIS keeps it in its output buffer until the EXE file has finished running.

How do I disable this output buffering that IIS performs? Either using IIS Manager, or using web.config - or the registry, maybe?
Any ideas?
0
Comment
Question by:stefanlennerbrant
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:Dan McFadden
ID: 41764940
You should look into the "Caching" controls available in IIS.

Reference Link:  https://www.iis.net/configreference/system.webserver/caching

I would recommend trying to control the output buffering (caching) at the user mode level.

The following links describe the config process in IIS7, which is valid for IIS8+ since the the element has not changed since its introduction in IIS7.  Second link is a nicely detailed article.

Links:
- http://www.iis.net/learn/manage/managing-performance-settings/configure-iis-7-output-caching
- https://codewala.net/2014/07/01/leverage-output-caching-with-iis7-x-and-iis8-x/

Dan
0
 

Author Comment

by:stefanlennerbrant
ID: 41764968
Thanks, but caching is not the issue here, I think.

Caching means that (selected) dynamic output is not re-generated by the applications (the CGI exe-file) when the user requests it - instead the result is taken from the IIS cache.
This is of course impossible to have for realtime database applications, so I disabled caching at the very beginning -- with the web.config "<system.webServer>" parameter "<caching enabled="false" enableKernelCache="false" />

Buffering, instead, is the function that output that is generated by the CGI exe-file is not immediately output to the user client as it is generated, but IIS "holds it" temporarily (just for a second, that is), and then sends all of the data to the end user when the application finishes running.

And it is this function that I'd like to disable.

/Stefan
0
 
LVL 26

Accepted Solution

by:
Dan McFadden earned 500 total points
ID: 41765148
I understand the difference between caching and buffering... you had not stated that you disabled caching in the OP.

I would try tweaking the CGi/FactCGI definition at the site level.  You can define an attribute on the ADD element that describes the CGI-exe module, called "responseBufferLimit" and seting it to zero should kill the buffering.

Something like this"

<add name="CGI-exe" path="your-file.exe" verb="*" modules="CgiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" responseBufferLimit="1024" />

Reference Link:   https://forums.iis.net/t/1078563.aspx

Dan
0
 

Author Closing Comment

by:stefanlennerbrant
ID: 41765163
Thanks

Actually I just found the solution myself  just now, a little different but the same principle.

I used IIS manager to open the Configuration for the virtual directory containing my EXE programs, selected the section "system.webServer/handlers" and then opened and edited the "ApplicationHost.config C2/c2" settings
There, I could set responseBufferLimit=0 for CgiModule

I suppose (?) that the effect is the same with your suggestion?
My solution proved to work as well.

Thanks,
/Stefan
0
 
LVL 26

Expert Comment

by:Dan McFadden
ID: 41765169
Same solution, but I would recommend that this be done done at the site (local) scope level.

Reason being is that this could be a performance issue with other types of FastCGI/CGI applications that are now or in the future, running on this server.

You tweak is at the server scope level.  If you have any other sites running on this IIS server, it will inherit the settings from the ApplicationHost.config file.

Dan
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now