FreeRadius Losing packets in Multi-Threads mode
Alan DeKok
aland at deployingradius.com
Wed Oct 26 12:36:55 CEST 2011
Alexandre Chapellon wrote:
> Did the very same test here, with very same results.
> I find this a little bit scary to imagine that some accounting packets
> are lost (meaning I have no "proof" the requests was answered and how.
Ah... after thinking about it some more, there is no problem.
The test is wrong.
Accounting packets have *nothing* which makes them unique, other than
the packet contents. If you're sending the same packet over and over,
it's a duplicate, and gets a duplicate response.
In single threaded mode, the server receives a packet, sends a reply,
and *deletes* all knowledge about the packet. When it receives the next
one, it gets processed as if it was a new packet.
In multi-threaded mode, the server receives a packet, hands it to a
thread, which processes it and sends a reply. Crucially, the packet
isn't deleted until later, because the server avoids thread locks.
While the packet is cached, the main thread receives a "new" packet,
which looks *exactly* the same as a packet in the cache. So... the main
thread re-sends the same reply.
If you look at the statistics from the server, you'll see the
"duplicate request" counter being very high. It SHOULD be zero for
accounting packets.
Alan DeKok.
More information about the Freeradius-Users
mailing list