Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > inetserver iis > june 2005 >

inetserver iis : IIS 6.0 problem with big HTTP uploads


François Lemaire
6/30/2005 11:43:08 AM
Hello,

I have recently upgraded a production server with Windows Server 2003, thus
my IIS 5.0 has become a IIS 6.0 ; one of the .NET web apps on this server is
using lots of HTTP uploads (multipart encoding), with sometimes very big
files (around 50-100Mo). This application works fine on IIS 5.0, but on IIS
6.0, when uploading a big file, there are many errors (the user sees an
"Action cancelled" page). I've searched every configuration setting remotely
linked to this and set it to very high levels, but nothing changes. Then I
started to look at performance counters, and especially the IIS received
octets counter, and it seems like IIS is receiving nothing during a very long
period of time, then boom it receives everything in a split second and the
response is sent. The bandwidth used during this explosion is way bigger than
our internet connection permits, thus i think that somebody is buffering the
request from IIS.

I remembered then that IIS 6.0 closes connections that are inactive for too
much time, and I will try to change this parameter, but this connection
should not be inactive since somebody is sending data. Is this a known bug or
limitation ? Is the behaviour I'm experiencing normal or is this a network
related issue ? (the server is behind a firewall).

David Wang [Msft]
6/30/2005 2:08:28 PM
It's probably not something within IIS. I have made posts of multiple
hundred megabytes to my own ISAPI Upload Acceptor from different machines
using default IIS6 configuration without issues.

It totally depends on how the client sends data (as soon as possible) and
how the server app receives data (in small buffered chunks,
asynchronously) -- and depending on how the client/server-app works, you may
need to configure IIS6 differently. But, as I've already said, the default
configuration for IIS6 can handle large POSTs without issues, so you are
mostly looking at specific requirements placed by your application
framework.

I would use Network Monitor to watch network traffic. It will tell you
precisely which packets arrived at the server and when -- perf counters are
not going to tell you exactly what bytes reached where -- which is what you
are looking for.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"François Lemaire" <FranoisLemaire@discussions.microsoft.com> wrote in
message news:35D0E136-A0F2-48A4-AF37-311685D66397@microsoft.com...
Hello,

I have recently upgraded a production server with Windows Server 2003, thus
my IIS 5.0 has become a IIS 6.0 ; one of the .NET web apps on this server is
using lots of HTTP uploads (multipart encoding), with sometimes very big
files (around 50-100Mo). This application works fine on IIS 5.0, but on IIS
6.0, when uploading a big file, there are many errors (the user sees an
"Action cancelled" page). I've searched every configuration setting remotely
linked to this and set it to very high levels, but nothing changes. Then I
started to look at performance counters, and especially the IIS received
octets counter, and it seems like IIS is receiving nothing during a very
long
period of time, then boom it receives everything in a split second and the
response is sent. The bandwidth used during this explosion is way bigger
than
our internet connection permits, thus i think that somebody is buffering the
request from IIS.

I remembered then that IIS 6.0 closes connections that are inactive for too
much time, and I will try to change this parameter, but this connection
should not be inactive since somebody is sending data. Is this a known bug
or
limitation ? Is the behaviour I'm experiencing normal or is this a network
related issue ? (the server is behind a firewall).

Thanks

François Lemaire
6/30/2005 11:45:01 PM
Thanks for the answer. I've worked on the issue and it seems to work (I cross
fingers, since it doesn't come out every time) when I raise the timeout
property for ASPNET, though I don't really understand why, since the code I
wrote to save the file to the disk executes very quickly (at least, quicker
than the ASPNET timeout...).

Maybe this is an issue of the kernel mode, maybe the timeout for ASPNET
starts before ASPNET actually starts processing the request (something like
HTTP.sys detects this is for ASPNET with the HTTP headers, starts ASPNET,
then waits for the attached files, and when the request is ready to process,
bang, the ASPNET timeout stops everything). I assure you this is a IIS 6.0
problem, I never had any problem with the same code on IIS 5.0. Is there a
way to monitor when the request is transmitted to ASPNET by HTTP.sys ? Maybe
somebody at Microsoft can check my assumptions ? I'll check network monitor
anyway.

Regards

François Lemaire

[quoted text, click to view]
David Wang [Msft]
7/1/2005 12:11:38 AM
Actually, what I am saying is that:
1. ASP.Net is an ISAPI DLL
2. I can write an ISAPI DLL that handles big HTTP uploads without problems
on both IIS5 and IIS6

#2 tells me that IIS6 doesn't have a problem with big HTTP uploads. Other
ISAPIs may have problems, but that is not an IIS issue -- it is specific to
that ISAPI. Whether you can solve the issue through configuration of the
ISAPI -- that is arbitrary behavior as far as IIS is concerned and is
between you and the ISAPI -- not an IIS problem.

This is why I say this is not something wrong with IIS 6 but rather
something wrong with either the client app, server app, or their
configuration.

Also, I suggest that you read the IIS6 Architectural Documentation on how
IIS6 request processing works.
http://www.microsoft.com/resources/documentation/IIS/6/all/techref/en-us/default.mspx

I do not know what "timeout" property you are modifying, so I cannot make
any more suggestions. It may be possible that your upload is not valid or
somehow forces ASP.Net to inefficiently read it as entity body -- in which
case you are just depending on arbitrary behavior, which can break on IIS6
and it would be by-design.

Bottom line: you have to figure out what is wrong before determining whether
this is your error or not. You cannot assume that "since this code worked on
IIS5, it must be right". Lots of sloppy stuff worked on IIS5 and is to blame
for its security issues, and we rewrote and removed all those problems in
IIS6 -- so it may be that you had some sloppy stuff that may not work
anymore, but that's the price you must pay for security.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"François Lemaire" <FranoisLemaire@discussions.microsoft.com> wrote in
message news:C7D3B741-C739-48E3-8340-C97798DF91C6@microsoft.com...
Thanks for the answer. I've worked on the issue and it seems to work (I
cross
fingers, since it doesn't come out every time) when I raise the timeout
property for ASPNET, though I don't really understand why, since the code I
wrote to save the file to the disk executes very quickly (at least, quicker
than the ASPNET timeout...).

Maybe this is an issue of the kernel mode, maybe the timeout for ASPNET
starts before ASPNET actually starts processing the request (something like
HTTP.sys detects this is for ASPNET with the HTTP headers, starts ASPNET,
then waits for the attached files, and when the request is ready to process,
bang, the ASPNET timeout stops everything). I assure you this is a IIS 6.0
problem, I never had any problem with the same code on IIS 5.0. Is there a
way to monitor when the request is transmitted to ASPNET by HTTP.sys ? Maybe
somebody at Microsoft can check my assumptions ? I'll check network monitor
anyway.

Regards

François Lemaire

[quoted text, click to view]

François Lemaire
7/1/2005 12:50:04 AM
Frankly, I have to say that I don't like the tone of this reply ; I'm only
using APIs given to me by Microsoft. The code for the page is pretty
straightforward : I use the Files collection of the HttpRequest object passed
to me by the infrastructure. What is "sloppy" there ? When the problem
arises, not a single line of my code has been called (the ASPNET timeout I'm
talking about ends the ASPNET processing before my code is called : how can
it be my fault ???). If Microsoft breaks its own software with every single
new version, that's not my problem, it's Microsoft's problem. If Microsoft
has done "sloppy" things in the past, it's not my problem, it's Microsoft's
problem. I would appreciate nicer answers than blaming me for using insecure
features when they are provided by Microsoft and my software has been broken
by Microsoft's changes.

But I guess my problem resides in the ASPNET ISAPI filter ; where shall I
post my questions if not on this newsgroup ? Isn't ASPNET ISAPI filter a part
of IIS ?

Regards

François Lemaire

[quoted text, click to view]
jeff.nospam NO[at]SPAM zina.com
7/2/2005 12:00:00 AM
On Thu, 30 Jun 2005 23:45:01 -0700, "François Lemaire"
[quoted text, click to view]

Just curious, how much RAM in the system?

Jeff



[quoted text, click to view]
François Lemaire
7/6/2005 6:08:04 AM
The production server (IIS 6.0) on which it didn't work without extending the
ASP.NET timeout has 1Go of memory. The test server (IIS 5.x) on which it
worked without extending the ASP.NET timeout has 512Mo, and I have another
production server using IIS 5.x where the code works that has 256Mo. I don't
think it's memory-related since memory consumption remains reasonable, but
who knows...

François

[quoted text, click to view]
jeff.nospam NO[at]SPAM zina.com
7/7/2005 12:00:00 AM
On Wed, 6 Jul 2005 06:08:04 -0700, "François Lemaire"
[quoted text, click to view]

The reason I ask is that I had a server behave similarly when first
configured. We finally received the backordered RAM and took it from
512 MB to 2 GB and the problem disappeared. I can't say if that was
what fixed the problem but it's really about the only change made
between not working and working. Best I could guess was that the app
wasn't writing data to the drive quickly enough until we had enough
RAM to buffer it.

jitaster
7/15/2005 4:58:02 PM
I am running into similar issue in IIS6.0. The application is receives a
binary file as multi-part post. On enableing the sniffer logs I saw tha the
HTTP 200 OK is being sent back by IIS somewhere in the middle, even though
the data is still being sent by the other side. In ASP page the ContentLength
is coming proper (same as in sniffer logs) but the Request.TotalBytes is
coming back as zero. Problem is happeneing only for larger files. Same
application is working fine on Windows XP and Windows 2000.
Tiago Halm
7/16/2005 12:00:00 AM
François, lets keep this technical as much as possible ...

Look into %SYSTEMROOT%\system32\LogFiles\HTTPErr and check the line(s) (if
any) that look suspicious.

I would assume one of these:
- HTTP.sys is not working properly;
- There's an ISAPI filter/extension there (besides ASP.NET) that is behaving
is some strange way;
- Your code is doing something strange;
- .NET has a problem with uploads;

Do the following:
- Dump here the contents of %SYSTEMROOT%\system32\LogFiles\HTTPErr
- Dump here which ISAPI Filters you have installed (global and local level)
- Dump here which Wildcard ISAPI Extensions you have installed (global and
local level)
- Get a "really" basic sample code reproducing the issue and dump it here;


Tiago Halm

"François Lemaire" <FranoisLemaire@discussions.microsoft.com> wrote in
message news:94324C07-DD3A-4BAC-BC52-14F989A4B935@microsoft.com...
[quoted text, click to view]
François Lemaire
7/16/2005 4:25:02 AM
My guess for the behaviour I encountered with ASP.NET is that the ASP.NET
ISAPI filter begins to count time before the request is completely arrived,
thus I get a timeout even before my code executes (the HttpHandler wakes up
when the request is arrived and says "Oh, it's too late, time's up!"). Maybe
you are experiencing a similar behaviour with ASP. I suggest you raise the
timeout for ASP requests in IIS administration (changing it in your code
won't have any effect if the behaviour is similar to my problem, since your
code is not executed...).

Hope this helps

François

[quoted text, click to view]
David Wang [Msft]
7/17/2005 2:37:12 AM
Actually, Francois's issue involves ASP.Net and is probably not similar to
your issue at all other than the fact that both your code are launched by
IIS6.

As documented, ASP on IIS6 introduces new upload/download limits
(configurable) of 200KB and 4MB, respectively, and will reject
request/response that go over the limit.
Upload limit - AspMaxRequestEntityAllowed
Download limit (only if buffering is enabled [default]) - AspBufferingLimit

Use adsutil.vbs to adjust them at the appropriate level (global,
per-website, etc)

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
[quoted text, click to view]
I am running into similar issue in IIS6.0. The application is receives a
binary file as multi-part post. On enableing the sniffer logs I saw tha the
HTTP 200 OK is being sent back by IIS somewhere in the middle, even though
the data is still being sent by the other side. In ASP page the
ContentLength
is coming proper (same as in sniffer logs) but the Request.TotalBytes is
coming back as zero. Problem is happeneing only for larger files. Same
application is working fine on Windows XP and Windows 2000.

AddThis Social Bookmark Button