[JDEV] Karma and Jabber 1.2 RC

Keith Minkler keith at digix.dyndns.org
Mon Oct 30 19:35:34 CST 2000


  See below...

> The behavior is a pretty steep throttle.  In the the 6000-12000 char message
> case
> above, it essentially shuts down the xmit window to a trickle until the
> message 
> finally gets out.

That is true, and it's done that way for a reason.. a "typical" message, such as "hi, how are you?" is only about 150 bytes of xml data.. so figure a "normal" max around 400 bytes per message, on average...  the user would have to send 3 such messages per every two seconds to *begin* to drop karma.. and they would have to sustain this rate for over 6-8 (or so) seconds to hit zero karma... this rate is considered abusive, when you consider a server that has 100K connected users on it... it's not giving each user their fair CPU timeslice.  

Messages of 6000-12000 characters are rare, and probably should be rate limited.. you can probably sneak this message by, if you have your karma set to a max of 15 or so, and it will go through without hitting zero karma... (if you still want to have limits).. or make the penalty less harsh, by default it's -5, which will pause for 10 seconds before reading from the socket again, you can make it -1, and it will only pause 2 seconds before reading again, also, if you change the restore value to match the max, they will get to send more data while they are being severly rate limited (out of karma)... since they will be restored to a higher karma, when thier penalty is "paid".  each of these, or both, will result in a higher "throughput" when sending a large ammount of data.

> Can I do that with settings in jabber.xml (what settings might I
> use?) or do 
> I need to go into the pthsock code and compile larger numbers in?

you can change that right in the jabber.xml file.. for example:
<service id="c2s">
 <pthcsock xmlns='jabber:config:pth-csock'>
  <!-- could be <authtime>10</authtime> for 10 seconds, etc -->
  <authtime/> <!-- unlimited time to auth -->
  <rate time="5" points="25"/> <!-- 25 connects in 5 seconds limit (per IP) -->

in the above jabber.xml snippet, (which is in CVS) there are a few configurable knobs.. <authtime>5</authtime> is the timeout (in seconds) they are given to successfully authenticate with the server.  <rate ... /> is a connection rate limit.. i.e. how fast you can connect to the server from the same IP address in a row.  and then there is the <karma/> section to configure the karma stuff... other things, like KARMA_INIT, and KARMA_READ_MAX will have to be done in the code, but IMHO, they do not need to be changed.. you can get the desired functionality from these other configurable bits.

> Just wondering...Are the rates mentioned in the karma.txt document 
>   (5.5K/2sec, 1K/2 sec) pretty much regarded as the typical usage/user?  

they are the rates i calculated based on the default karma values -- if they are wrong, let me know, and i will update that readme

>   I notice that other chat systems like IRC have file transfer capabilities,
>   is Jabber expected to be able to do this?  Will these xfer windows work
>   for this?  Is this a client issue, meaning that the client needs to be
> aware
>   of these windows and be intelligent enough to pace itself during
> transmissions?

Yes, on all counts, however, file transfers happen "out of band" via direct client to client HTTP transfers, so this bypasses io rate limits all together.  (unless the client implements them for some reason)


Keith Minkler

More information about the JDev mailing list