Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Disable output buffering in IIS8 for CGI exe file output

Posted on 2016-08-20
5
Medium Priority
?
161 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 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

730 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