Solved

Disable output buffering in IIS8 for CGI exe file output

Posted on 2016-08-20
5
95 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 27

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 27

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 27

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Http hosting redirect issue 2 51
How configure a site in IIS 8 to redirect to an specific URL 3 164
Editing XSL files, 2 58
IIS 8 and certificate 8 17
Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 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