Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

AspBufferingLimit and impact on server performance

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  IIS: Could not start the HTTP SSL service on local computer  
Author Message
tedqn

External


Since: Jan 20, 2006
Posts: 3



(Msg. 1) Posted: Fri Jan 20, 2006 3:09 pm
Post subject: AspBufferingLimit and impact on server performance
Archived from groups: microsoft>public>inetserver>iis (more info?)

I've increased the max buffer to 40MB to accommodate upload and
download (protected files using ASP Stream). I'm wonder what kind of
impact this have on the server performance. It seems that the only
impact is the potential page with infinite loop and not stopped before
it reaches 40MB vs the 4MB default. Other than that, it's just the
limit. Pages that don't involve download/upload just use the usual
buffer amount. Anything else?

 >> Stay informed about: AspBufferingLimit and impact on server performance 
Back to top
Login to vote
"Egbert Nierop

External


Since: Oct 14, 2005
Posts: 201



(Msg. 2) Posted: Sat Jan 21, 2006 8:55 am
Post subject: Re: AspBufferingLimit and impact on server performance [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<tedqn RemoveThis @yahoo.com> wrote in message
news:1137798544.839007.42100@g43g2000cwa.googlegroups.com...
> I've increased the max buffer to 40MB to accommodate upload and
> download (protected files using ASP Stream). I'm wonder what kind of
> impact this have on the server performance. It seems that the only
> impact is the potential page with infinite loop and not stopped before
> it reaches 40MB vs the 4MB default. Other than that, it's just the
> limit. Pages that don't involve download/upload just use the usual
> buffer amount. Anything else?
>

Whynot disable buffering on the specific upload/download page? This is
because buffering makes no sense for a chunked straight stream and buffering
costs really lots of resources.

 >> Stay informed about: AspBufferingLimit and impact on server performance 
Back to top
Login to vote
tedqn

External


Since: Jan 20, 2006
Posts: 3



(Msg. 3) Posted: Sat Jan 21, 2006 10:47 pm
Post subject: Re: AspBufferingLimit and impact on server performance [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Are you sure? If disabling buffer would work for upload/download, I'd
be more than happy to do it instead of modifying the buffer limit.
Other people suggested breaking the data into smaller chunks and run a
loop..
 >> Stay informed about: AspBufferingLimit and impact on server performance 
Back to top
Login to vote
"Egbert Nierop

External


Since: Oct 14, 2005
Posts: 201



(Msg. 4) Posted: Sun Jan 22, 2006 5:55 am
Post subject: Re: AspBufferingLimit and impact on server performance [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<tedqn RemoveThis @yahoo.com> wrote in message
news:1137912447.565104.248660@g47g2000cwa.googlegroups.com...
> Are you sure? If disabling buffer would work for upload/download, I'd
> be more than happy to do it instead of modifying the buffer limit.
> Other people suggested breaking the data into smaller chunks and run a
> loop..
>
They are right.
(b.t.w. ISAPI 6.0 for IIS6 allows a specific extension to upload/download,
it does not cache and it does not exhaust resources as -all- other previous
methods do)

You should do it in chunks of say 4096 bytes.
And disable the buffering for the specific page
sample:

Response.Buffer = false

'Set the content type to the specific type that you are sending.

Response.ContentType = "application/x-zip-compressed" 'or use your own
content type here...

Dim strFilePath, lSize, lBlocks
Const CHUNK = 2048
set objStream = CreateObject("ADODB.Stream")

objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath
lSize = objStream.Size
Response.AddHeader "Content-Length", lSize
lBlocks = 1
For lBlocks = lBlocks To lSize \ CHUNK
If Response.IsClientConnected = False Then Exit For
Response.BinaryWrite objStream.Read(CHUNK)
Next
lSize = lSize MOD CHUNK
If lSize > 0 And Response.IsClientConnected = True Then
Response.BinaryWrite objStream.Read(lSize)
End If

objStream.Close
 >> Stay informed about: AspBufferingLimit and impact on server performance 
Back to top
Login to vote
tedqn

External


Since: Jan 20, 2006
Posts: 3



(Msg. 5) Posted: Mon Jan 23, 2006 12:08 pm
Post subject: Re: AspBufferingLimit and impact on server performance [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Well I tried your code and immediately go a page error that says
buffering must be turned on. Also came across a post which someone
claimed the chunk size method produced a corrupted PDF.

After some further research my final solution is

.....................
Response.AddHeader "Content-Length", objStream.Size 'to show the total
size on the save dialog

Response.Buffer = False 'must be AFTER the Response.AddHeader
While Not objStream.EOS
Response.BinaryWrite(objStream.Read(2048))
WEnd
ObjStream.Close
 >> Stay informed about: AspBufferingLimit and impact on server performance 
Back to top
Login to vote
"Egbert Nierop

External


Since: Oct 14, 2005
Posts: 201



(Msg. 6) Posted: Mon Jan 30, 2006 7:55 am
Post subject: Re: AspBufferingLimit and impact on server performance [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<tedqn.TakeThisOut@yahoo.com> wrote in message
news:1138046894.165097.40360@f14g2000cwb.googlegroups.com...
> Well I tried your code and immediately go a page error that says
> buffering must be turned on. Also came across a post which someone
> claimed the chunk size method produced a corrupted PDF.
>
> After some further research my final solution is
>
> ....................
> Response.AddHeader "Content-Length", objStream.Size 'to show the total
> size on the save dialog


Ok then here the final script. Don't forget the 'is connected' property.
Because if the client disconnects, your loop will create some stress


Response.ContentType = "application/x-zip-compressed" 'sample contenttype

Dim strFilePath
Const CHUNK = 2048
strFilePath = [yourfile]
objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath

Response.AddHeader "Content-Length", objStream.Size
Response.Buffer = False
Do Until objStream.EOS Or Not Response.IsClientConnected
Response.BinaryWrite(objStream.Read(CHUNK))
Loop

objStream.Close
 >> Stay informed about: AspBufferingLimit and impact on server performance 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]