Konstantin, On 9/30/13 11:32 AM, Konstantin Preißer wrote: > Hi Chris, > >> -----Original Message----- >> From: Christopher Schultz [mailto:ch...@christopherschultz.net] >> Sent: Monday, September 30, 2013 5:19 PM >> To: Tomcat Developers List >> Subject: Re: Possible IIS SPDY Redirector for Tomcat >> >> Konstantin, >> >> On 9/28/13 1:40 PM, Konstantin Preißer wrote: >>> Contra: >>> - Worse performance than the native ISAPI redirector. I made a test by a >> Servlet that produces 700 MB of random data, and on a separate machine I >> used a program to make a HTTP request and read the data. The average >> transfer speed was ~ 98 MByte/s, and the IIS worker process had around >> 50% CPU usage, whereas Jetty had only 12 %. >> >> How good of a C# programmer are you? Perhaps you could have someone >> else >> look at it to make sure you aren't doing something that has obvious >> performance drawbacks (e.g. using an un-buffered stream often results in >> a kernel call for each byte of data to be transferred). > > Thanks for your reply. Yes, that redirector is only a draft and could have > some performance issues. > > However, I have done a Test with IIS 8.0 and a simple ASP.Net Handler (.ashx) > that just writes ~625 MB of random data by writing a 327680 bytes array 2000 > times to the response: > > public class Handler1 : IHttpHandler { > > public void ProcessRequest(HttpContext context) { > HttpResponse response = context.Response; > response.ContentType = "text/plain"; > response.AddHeader("Content-Disposition", "attachment; > filename=abc.txt"); > > byte[] bytes = new byte[327680]; > for (int i = 0; i < bytes.Length; i++) { > bytes[i] = (byte)((i * 12345 + 98237) % 255); > } > > using (Stream sout = response.OutputStream) { > for (int i = 0; i < 2000; i++) { > sout.Write(bytes, 0, bytes.Length); > response.Flush(); > } > } > } > > public bool IsReusable { > get { return true; } > } > } > > And I still get ~ 50% CPU usage by the IIS worker process (w3wp.exe) > while the transfer speed is about 100 MByte/s. > > So it seems that the main performance problem is IIS when using > managed code/ASP.Net to write to the response, but I need to do > additional testing.
Wow. Are you sure the thread burning the CPU is the one running the above code? Seems ... unfortunate. -chris
signature.asc
Description: OpenPGP digital signature