HighTechTalks DotNet Forums  

Serious Performance, can .NET handle it?

Dotnet Framework (Performance) microsoft.public.dotnet.framework.performance


Discuss Serious Performance, can .NET handle it? in the Dotnet Framework (Performance) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Cablito
 
Posts: n/a

Default Serious Performance, can .NET handle it? - 10-13-2004 , 08:47 AM






I want to write a HTTP proxy with C#, but I am unsure if it will scale;

I need to handle at least 5000 simultaneous users per server.

The servers can be MP with 2GB ram, that isnīt the issue. I will be
filtering the http streams for keywords, so there is a processing load
there.



Reply With Quote
  #2  
Old   
Sriram Krishnan
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-13-2004 , 12:39 PM






Well - only one way to find out - try writing one and throw the tester at it

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram


"Cablito" <cablito (AT) dontspam (DOT) com> wrote

Quote:
I want to write a HTTP proxy with C#, but I am unsure if it will scale;

I need to handle at least 5000 simultaneous users per server.

The servers can be MP with 2GB ram, that isnīt the issue. I will be
filtering the http streams for keywords, so there is a processing load
there.





Reply With Quote
  #3  
Old   
Cablito
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 07:10 AM



in a way you are absolutelly right.... but the "test" environment is an ISP
client base of thousands of paying customers. No room for mistakes.


"Sriram Krishnan" <ksriram (AT) NOSPAMgmx (DOT) net> escreveu na mensagem
news:%23QI%23qwUsEHA.3268 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Quote:
Well - only one way to find out - try writing one and throw the tester at
it

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram


"Cablito" <cablito (AT) dontspam (DOT) com> wrote in message
news:esNyvrSsEHA.904 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
I want to write a HTTP proxy with C#, but I am unsure if it will scale;

I need to handle at least 5000 simultaneous users per server.

The servers can be MP with 2GB ram, that isnīt the issue. I will be
filtering the http streams for keywords, so there is a processing load
there.







Reply With Quote
  #4  
Old   
Justin Rogers
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 07:27 AM



Naively programmed, .NET is not going to scale. There are many mistakes you
can make in this process. Honestly, any language would suffer the same demise.
As long as you know what you are doing, and stick to stream management
operations you should be fine. Because you are going to be doing stream
management, the BCL classes are not going to help you much. You can't, for
instance, arbitrarily start pulling strings out of a stream (aka using
encodings)
because you are going to quickly run into GC problems.

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Cablito" <cablito (AT) dontspam (DOT) com> wrote

Quote:
in a way you are absolutelly right.... but the "test" environment is an ISP
client base of thousands of paying customers. No room for mistakes.


"Sriram Krishnan" <ksriram (AT) NOSPAMgmx (DOT) net> escreveu na mensagem
news:%23QI%23qwUsEHA.3268 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Well - only one way to find out - try writing one and throw the tester at
it

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram


"Cablito" <cablito (AT) dontspam (DOT) com> wrote in message
news:esNyvrSsEHA.904 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
I want to write a HTTP proxy with C#, but I am unsure if it will scale;

I need to handle at least 5000 simultaneous users per server.

The servers can be MP with 2GB ram, that isnīt the issue. I will be
filtering the http streams for keywords, so there is a processing load
there.









Reply With Quote
  #5  
Old   
Jon Skeet [C# MVP]
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 07:59 AM



Cablito <cablito (AT) dontspam (DOT) com> wrote:
Quote:
in a way you are absolutelly right.... but the "test" environment is an ISP
client base of thousands of paying customers. No room for mistakes.
If you were really thinking of deploying *anything* without testing it
in a less risky fashion, I think you're playing with fire.

Throwing the tester at something should *not* mean deploying it in a
live production environment.

I believe what Sriram was saying was that you should build it (or at
least a prototype) then rig up a test system (which should almost
certainly consists of many different machines) to stress test the app.

--
Jon Skeet - <skeet (AT) pobox (DOT) com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Reply With Quote
  #6  
Old   
Cablito
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 08:16 AM



Can I therefore assume the encoding classes arenīt memory efficient?


"Justin Rogers" <Justin (AT) games4dotnet (DOT) com> escreveu na mensagem
news:eHc9uIrsEHA.3320 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
Quote:
Naively programmed, .NET is not going to scale. There are many mistakes
you
can make in this process. Honestly, any language would suffer the same
demise.
As long as you know what you are doing, and stick to stream management
operations you should be fine. Because you are going to be doing stream
management, the BCL classes are not going to help you much. You can't, for
instance, arbitrarily start pulling strings out of a stream (aka using
encodings)
because you are going to quickly run into GC problems.

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Cablito" <cablito (AT) dontspam (DOT) com> wrote in message
news:ezfxy%23qsEHA.3600 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
in a way you are absolutelly right.... but the "test" environment is an
ISP
client base of thousands of paying customers. No room for mistakes.


"Sriram Krishnan" <ksriram (AT) NOSPAMgmx (DOT) net> escreveu na mensagem
news:%23QI%23qwUsEHA.3268 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Well - only one way to find out - try writing one and throw the tester
at
it

--
Sriram Krishnan

http://www.dotnetjunkies.com/weblog/sriram


"Cablito" <cablito (AT) dontspam (DOT) com> wrote in message
news:esNyvrSsEHA.904 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
I want to write a HTTP proxy with C#, but I am unsure if it will
scale;

I need to handle at least 5000 simultaneous users per server.

The servers can be MP with 2GB ram, that isnīt the issue. I will be
filtering the http streams for keywords, so there is a processing
load
there.











Reply With Quote
  #7  
Old   
David Browne
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 03:46 PM




"Cablito" <cablito (AT) dontspam (DOT) com> wrote

Quote:
Can I therefore assume the encoding classes arenīt memory efficient?


No, they are fine, but you must take care.




Reply With Quote
  #8  
Old   
David Browne
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 03:51 PM



"Cablito" <cablito (AT) dontspam (DOT) com> wrote

Quote:
Can I therefore assume the encoding classes arenīt memory efficient?

oops,

The encoding classes are fine, but you must be careful.

This method

char[] GetChars(byte[]);

Allocates a new char[] for each call. In a high-performance application, it
should be avoided.

Instead use this one:

int GetChars(byte[], int, int, char[], int);

Which requires you to supply your own char[], which you can reuse over and
over.

That's the kind of thing to keep in mind when asking wether .NET can handle
the performance. Exactly the same issues occur with Java and C++. For
high-performance applications you have to know when you are allocating new
memory. All these languages make it easy to allocate memory without knowing
it, and so you just need to take care.

David




Reply With Quote
  #9  
Old   
Justin Rogers
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 07:13 PM



Also, there are NO routines for examining a character array, only a
string. So even if you use the memory efficient character scanning
methods you'll need to write all of your character and pattern matching
from scratch.

That is more of where I was heading with encodings, since most users
will want the pattern matching available on either the string or regular
expression classes.


--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"David Browne" <davidbaxterbrowne no potted meat (AT) hotmail (DOT) com> wrote

Quote:
"Cablito" <cablito (AT) dontspam (DOT) com> wrote in message
news:%238QMDkrsEHA.3984 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Can I therefore assume the encoding classes arenīt memory efficient?

oops,

The encoding classes are fine, but you must be careful.

This method

char[] GetChars(byte[]);

Allocates a new char[] for each call. In a high-performance application, it
should be avoided.

Instead use this one:

int GetChars(byte[], int, int, char[], int);

Which requires you to supply your own char[], which you can reuse over and
over.

That's the kind of thing to keep in mind when asking wether .NET can handle
the performance. Exactly the same issues occur with Java and C++. For
high-performance applications you have to know when you are allocating new
memory. All these languages make it easy to allocate memory without knowing
it, and so you just need to take care.

David




Reply With Quote
  #10  
Old   
David Browne
 
Posts: n/a

Default Re: Serious Performance, can .NET handle it? - 10-15-2004 , 07:31 PM




"Justin Rogers" <Justin (AT) games4dotnet (DOT) com> wrote

Quote:
Also, there are NO routines for examining a character array, only a
string. So even if you use the memory efficient character scanning
methods you'll need to write all of your character and pattern matching
from scratch.

That is more of where I was heading with encodings, since most users
will want the pattern matching available on either the string or regular
expression classes.


That's a good point. And the problem with writing your own pattern matching
is that array access in safe code is slow.
David




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.