2015-04-21 15:38 GMT+02:00 Alan DeKok <aland@deployingradius.com>:
On Apr 21, 2015, at 2:35 AM, Marcin <marcin@nicram.net> wrote:
So, which is better solution for performance: keep accounting data in details file, then read it and write to db with buffered-sql or write accounting to database directly?
Typically writing to a database directly is lower latency than writing to the detail file and then to the DB.
Yes, but i don't care about latency. I can have even one minute late write to DB. What is more important to me it's performance and speed of freeradius answers.
In v3, the pool configuration helps a lot. Set a "max" number of connections the DB can handle, and fail-over to the detail file. In normal operation, everything goes directly to the DB. If you get a huge spike of traffic, the detail file fills up. And then drains slowly when the spike goes away.
You say about "fail-over", do you have redundant on your thought? redundant { sql detail } and then start buffered-sql. Is that right?
In configuration file buffered-sql we can read: #v+ The server can read accounting packets from the detail file much more quickly than those packets an be written to a database. If the database is overloaded, then bad things can happen.
Yes, which means you can read 100K packets/s from the detail file, and only write 2K packets/s to the DB. This shouldn't be surprising.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Pozdrawiam Marcin / nicraM