Solved

Disable output buffering in IIS8 for CGI exe file output

Posted on 2016-08-20
5
130 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 28

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 28

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 28

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

623 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