aland [Mon, 14 May 2007 09:42:51 +0000 (09:42 +0000)]
Use "currently_outstanding" metric for load-balance. i.e. we choose
the home server with the lowest "currently_outstanding" number.
If there are multiple home servers with the same number, randomly
choose among them.
This means that when a home server is dead and doesn't respond,
the requests will immediately be load-balanced to any live servers
aland [Mon, 14 May 2007 07:54:58 +0000 (07:54 +0000)]
Made language more consistent.
When a home server first responds, decrement the
"currently_outstanding" counter. This counter tracks the requests
being processed by the home server, NOT the number of retransmits
aland [Wed, 9 May 2007 13:41:35 +0000 (13:41 +0000)]
Re-parent the SNMP MIBs to use our own OID, rather than gnome's
OID. Gnome also seems to be using 3317 rather than 3319, which
is what IANA says was assigned to them.
aland [Wed, 9 May 2007 13:16:00 +0000 (13:16 +0000)]
struct timeval->tv_sec may not be time_t on MAC OS, 64-bit.
i.e. struct timeval->tv_sec is 64-bit, and localtime_t() etc
take a 32-bit pointer.
If we need to remove "request->timestamp" in the future, we can
update the calls to localtime_r(), etc. to use an intermediate
variable, to avoid 32/64-bit issues.
aland [Fri, 4 May 2007 09:18:08 +0000 (09:18 +0000)]
Added a self-pipe as per Emile's ideas at:
http://www.xs4all.nl/~evbergen/unix-signals.html
We don't need to handle more than 2-3 signals, so it all fits
into one byte.
Also added "detail" flag, so we can later add feedback from the
child threads. If there are no queued requests, AND there's at
least one thread waiting for something to do, THEN it's OK to read
from the detail file.
aland [Thu, 3 May 2007 12:47:38 +0000 (12:47 +0000)]
Re-arrange parsing order so that home servers aren't nested
in server pools, and server pools aren't nested in realms.
This makes debugging output easier to read.
aland [Thu, 3 May 2007 09:03:16 +0000 (09:03 +0000)]
Standardized format for debugging output, after a few trials
of different methods. The new output is cleaner, less noisy,
and it's more obvious what's going on.
aland [Wed, 2 May 2007 13:19:01 +0000 (13:19 +0000)]
In the authorize stage, return OK if we see TTLS or PEAP, which
means that the administrator can use configurable failover to skip
whole chunks of LDAP lookups, etc. if the outer tunnel setup
is going on
Run Status-Server packets through Autz-Type or Acct-Type of
Status-Server. Then, depending on the result (OK/fail), either
respond to the Status-Server request, or suppress the response.
Rename "ping" check to "status" check. This means existing
configurations break. However, given discussion on the users list,
calling the packets "pings" will confuse a certain segment of
the population in ways that are difficult to correct politely.
Now that we have priorities for thread queues, push the
post-proxy-type "fail" entry into the highest priority queue, so
that it's dealt with as soon as possible, but in a child thread
Re-ordered RAD_LISTEN_TYPE by priority, and added "priority"
field to the REQUEST.
Updated threads to have RAD_LISTEN_TYPE_MAX fifo's, and to insert
REQUEST's into the appropriate fifo. Then, when pulling requests
from the queue, we pull from high priority to low, and starve
any lower priority queues. This should make the server more robust
in high load situations.
i.e. we handle responses from home servers first, then authentication
requests, then accounting requests (because the NAS will retransmit
them), then the "detail" file, and finally SNMP.
We haven't integrated SNMP sockets into this scheme yet, but the
idea will work. We also need to update the code so that it doesn't
even look at a socket if there are pending requests.
i.e. if all the threads are busy, AND fifo N has entries, then do
NOT look at sockets associated with priorities N+1 and following.
New function post_proxy_fail(), which runs the request through
a Post-Proxy-Type = Fail.
Wrapper function proxy_proxy_fail_handler(), which does some other
things, (setup, re-does wait_a_bit, etc). Once we have multiple
queues for the threads, we can push the post-proxy handler onto
the thread queue, as it may do DB calls, which we should avoid
in the main server.
This has also cleaned up some corner cases, were the server could
respond without copying Proxy-State from the request, if the
proxying failed. We now run the REQUEST through standard functions
for everything...
Moved 'hash' to before 'vector', as it was right next to vps.
hash is read in the main thread, and vps is written to in child
threads. Having them next to each other results in cache line
bouncing. Moving it means that there won't be cache line
bouncing, for a small performance increase