<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type><TITLE>RE: [JDEV] Performance</TITLE><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META content='"MSHTML 4.72.3612.1706"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000000 size=2>David,</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT> </DIV>
<DIV><FONT size=2>When you refer to the stack and heap below, are you referring
to the thread that services the connection?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT color=#000000 size=2>I believe the way to improve that situation
would be to have a pool of threads servicing many connections. Most
software that uses threads to take advantage of parallelism does so
wastefully. The ideal situation is to have one or two processes working
(runnable) per CPU. This works find when other threads are
blocked/sleeping, performance suffers when the number of runnable tasks is too
high in relation to the number of CPUs able to service them. Performance
also suffers from the overhead of context switches -- and the memory needed to
create all those threads. One way to solve this is to have a pool of
threads that are all able to service any of the available connections. If
utilization is light, then probably only one thread will ever be used, and it
will save context switches, as well as memory. When the load begins to
increase, more threads are called into use. The key is to not have too
many worker threads unless what a worker thread does can block. Too many
threads causes degradation in overall performance due to context switching and
synchronization. Too few and you have network events that are not dealt
with in a timely fashion.</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT> </DIV>
<DIV><FONT size=2>I hope this is useful (for any and all).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>-- Jacob.</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: 5px">
<DIV><FONT face=Arial size=2><B>-----Original Message-----</B><BR><B>From:
</B>David Waite <<A
href="mailto:mass@ufl.edu">mass@ufl.edu</A>><BR><B>To: </B><A
href="mailto:jdev@jabber.org">jdev@jabber.org</A> <<A
href="mailto:jdev@jabber.org">jdev@jabber.org</A>><BR><B>Date:
</B>Wednesday, 26 April 2000 08:48<BR><B>Subject: </B>RE: [JDEV]
Performance<BR><BR></DIV></FONT>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000>The number of open sockets is indeed a big issue.
The main memory 'eater' with multiple TCP/IP sockets is the kernel-level
memory. At last I heard (which is another way of saying 'don't hold me to
these numbers'), one active client connection took about
50k.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000>With Linux, you have to do some kernel
reconfiguration to get above 1024 file descriptors per process(temas today
explained how to do it without recompiling the kernel, I need to explore
this area of l-k more). a TCP connection is of course represented by a file
descriptor.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000>Note that much of the memory above is stack for
each session. Even if you somehow eliminated the stack and the heap for each
open connection, you'd find that the kernel memory for each client was about
16k (which is unswapable). You could <STRONG>possibly</STRONG> get this down
to 8k (two 4k pages), but one 4k page does not have enough space to handle
an active TCP connection.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=900103120-25042000>At
least (from the numbers I've seen) the server is not
CPU-limited.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=900103120-25042000>So
unless you rewrote the Jabber server to not require separate stack spaces,
and rewrote some operating system kernel to somehow 'share' a large
datablock between many 'idle' TCP sockets, I don't know of any way you could
acheive an extremely large number of users on one server. I do not know of
any operating system that can handle an extremely large number of TCP
connections- 10k is ususlly the first real limit a machine
hits.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=900103120-25042000>It
would seem the only other feasible you can manage this is to rewrite
the Jabber server to allow clusters of machines. You could also attempt to
modify the Jabber protocol to use UDP, but then you would have something new
that wasn't Jabber anyways.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=900103120-25042000>-David Waite</SPAN></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: 5px">
<DIV align=left class=OutlookMessageHeader dir = ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> jdev-admin@jabber.org
[mailto:jdev-admin@jabber.org]<B>On Behalf Of </B>Michael
Petras<BR><B>Sent:</B> Tuesday, April 25, 2000 10:20 AM<BR><B>To:</B>
'jdev@jabber.org'<BR><B>Cc:</B> Douglas Petty<BR><B>Subject:</B> RE:
[JDEV] Performance<BR><BR></DIV></FONT>
<P><FONT color=#0000ff face=Arial size=2>One aspect of performance I was
wondering how Jabber addresses is the number of open sockets. Does
the</FONT> <BR><FONT color=#0000ff face=Arial size=2>Jabber server keep
a TCP socket open for each logged in client? What determines how many
sockets can be open</FONT> <BR><FONT color=#0000ff face=Arial
size=2>simulatenously using Linux? Does Jabber or Linux do any tricks to
increase the number of open sockets (such as</FONT> <BR><FONT
color=#0000ff face=Arial size=2>transforming open, but quiet sockets
into some placeholder objects that use minimal memory until the next
message)?</FONT> <BR><FONT color=#0000ff face=Arial size=2>Does anyone
know of any implementations that do this? Does anyone know how big
IM/presence servers like Yahoo, ICQ </FONT><BR><FONT color=#0000ff
face=Arial size=2>or AOL handles this?</FONT> </P>
<P><FONT color=#0000ff face=Arial size=2>Our applications have to
communicate with tens to hundreds of thousands of fairly low traffic
clients. Our servers run on </FONT></P>
<P><FONT color=#0000ff face=Arial size=2>Windows NT where the limit on
open sockets is a significant issue. Thanks in advance for any
info.</FONT> </P>
<P><FONT color=#0000ff face=Arial
size=2>
Thnx,</FONT> <BR><FONT color=#0000ff face=Arial
size=2>
Mike Petras</FONT> </P>
<UL>
<P><FONT face=Arial size=1>-----Original Message-----</FONT>
<BR><B><FONT face=Arial size=1>From: </FONT></B> <FONT
face=Arial size=1>David Waite [SMTP:mass@ufl.edu]</FONT>
<BR><B><FONT face=Arial size=1>Sent: </FONT></B> <FONT
face=Arial size=1>Tuesday, April 25, 2000 8:26 AM</FONT>
<BR><B><FONT face=Arial
size=1>To: </FONT></B> <FONT face=Arial
size=1>jdev</FONT> <BR><B><FONT face=Arial
size=1>Subject: </FONT></B>
<FONT face=Arial size=1>RE: [JDEV] Performance</FONT> </P>
<P><FONT face=Arial size=2>It sounds more like the test was
throttled due to you sending too many</FONT> <BR><FONT face=Arial
size=2>messages at once, rather than any sort of scalability or
other type of</FONT> <BR><FONT face=Arial size=2>limitation in the
Jabber server.</FONT> </P>
<P><FONT face=Arial size=2>-David Waite</FONT> </P><BR>
<P><FONT face=Arial size=2>-----Original Message-----</FONT>
<BR><FONT face=Arial size=2>Hi ,</FONT> <BR><FONT face=Arial
size=2> The real issue
which I want to highlight is not spammers but the</FONT> <BR><FONT
face=Arial size=2>Scalability of Jabber . The tests which I
performed on Jabber clearly showed</FONT> <BR><FONT face=Arial
size=2>that it slows down which is definitely not acceptable in
real-life</FONT> <BR><FONT face=Arial size=2>situations . Jabber has
to be more scalable than it is now . Any Thoughts</FONT> <BR><FONT
face=Arial size=2>and Ideas ?</FONT> <BR><FONT face=Arial
size=2>Regards ,</FONT> <BR><FONT face=Arial size=2>chetan s .
ithal</FONT> </P><BR>
<P><FONT face=Arial
size=2>_______________________________________________</FONT>
<BR><FONT face=Arial size=2>jdev mailing list</FONT> <BR><FONT
face=Arial size=2>jdev@jabber.org</FONT> <BR><FONT face=Arial
size=2><A href="http://mailman.jabber.org/listinfo/jdev"
target=_blank>http://mailman.jabber.org/listinfo/jdev</A></FONT>
</P></UL></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>