FreeRADIUS data structure help
Dear Development Team I have FreeRADIUS deployment where Im using sql module for authentication/authorization with no accounting at all. Im looking for a possibility where FreeRADIUS loads all information from database into some data structure of its own and sends back the response to a request based on the information it has in the data structure. In this way, it doesnt go to the database on each request rather replies back from the information it has. However, the information loaded from database should be updated periodically (may be in a seperate thread) so that the data structure holds an updated copy of information. By doing this, i want to minimize the overhead of fetching information from db on each request especially on a very busy system where database might not be colocated Please let me know, is there any way to do this? And also what are the pros and cons of this approach with respect to FreeRADIUS's working/performance. Thanks in advance. -- Best Regards Atif Razzaq http://atif-razzaq.blogspot.com -- Best Regards Atif Razzaq http://atif-razzaq.blogspot.com
On Thu, Mar 03, 2011 at 02:21:04PM +0500, Atif Razzaq wrote:
I have FreeRADIUS deployment where Im using sql module for authentication/authorization with no accounting at all. Im looking for a possibility where FreeRADIUS loads all information from database into some data structure of its own and sends back the response to a request based on the information it has in the data structure. In this way, it doesnt go to the database on each request rather replies back from the information it has. However, the information loaded from database should be updated periodically (may be in a seperate thread) so that the data structure holds an updated copy of information. By doing this, i want to minimize the overhead of fetching information from db on each request especially on a very busy system where database might not be colocated
In general, the approach I'd suggest is: build a working system first, measure, then optimise. You don't say which database you're using, but if it's mysql you can very easily make a local replica (using mysql replication). This will update very quickly, within a second or two, but minimise load on the remote DB and continue to work if the link goes down. And a system like this is very easy to administer and debug. If you really want an in-RAM database, then use rlm_fastusers. Do a periodic query which 'selects' the entire SQL database and writes it to a temporary file, then mv this temporary file into its final place. rlm_fastusers will automatically re-read this file into RAM when it notices it has changed. Regards, Brian.
Atif Razzaq wrote:
Please let me know, is there any way to do this? And also what are the pros and cons of this approach with respect to FreeRADIUS's working/performance.
FreeRADIUS is not a database. It is much better to configure a database so that it works. This may mean DB replication between the remote site and the machine running FreeRADIUS. This will work MUCH better than hacking FreeRADIUS to pretend to be a database. Alan DeKok.
participants (3)
-
Alan DeKok -
Atif Razzaq -
Brian Candler