io_select Karma demystified
---------------------------

io_select uses a "karma" based system to control socket io
rate limits.  The more karma you have, the more you are
allowed to write data to your socket.

You are allowed to write Karma*100 bytes of data to your
socket.  In addition to your karma, the server keeps track
of how much data you have written lately.  

The only thing that will raise your karma is time.  karma
is raised every two seconds.  In addition to raising your
karma, it will lower you recent "bytes sent" count by 
karma*100 bytes.

You are penalized for writing too much data to the socket
at once.  The lower your karma is, the more this penalty
has effect.  If you have a negative karma, the server will
not read from your socket at all, until your karma is
positive again.

If your recent "bytes sent" count is greater than karma*100,
your karma is lowered, which will also lower the number of
bytes the server will read from you.

most of the karma values are configurable.  The only values
that cannot be configured outside of io_select, are the
rate at which karma regenerates, currently 2 seconds, and
the karma*100 value.  (These can be configured as compile-
                time defines however).  

Values that can be changed outside of io_select, on a per-
socket basis are: current karma, current bytes_read, a max
karma (you cannot have more than this ammount), an "init" value,
for a first time init (normal karma operation should never hit
                this value -- sets to "restore" value), how much karma is 
incremented/decremented, the "penalty" for dropping to zero 
karma (usually a negative value, karma gets set to this value, 
                when you hit zero).  the "restore" value for when your karma 
*raises* to zero (when karma is negative,and raises to zero, 
                this value becomes the new karma).

By default, these numbers start at: 5,0,10,-10,-5, and 5,
respectivly.  using these numbers, a person with maximum
karma (10), will be able to send 1000 bytes every two seconds,
without incuring any penalties.  They would also be able to send
a burst of up to 5.5K in two seconds, without hitting zero 
karma.  Once the user hits zero karma, they would only be able
to sustain a rate of about 1.5K every 10 seconds, until they
wait for their karma to raise to a more normal value.

