Hi I’m using freeradius 2.1.12 with external program calling for auth, pre-auth and acct A while after radius up, it reports: Sat Nov 26 13:02:03 2011 : Error: Couldn't fork /etc/netbill/acct.pl: Cannot allocate memory The machine is: 12 G ram, CentOS 5.4, Kernel 2.6.18-164.el5PAE 32 bits Vmstat shows at least 6.8G FREE: procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 1 0 0 6864832 17424 553392 0 0 0 0 3707 7184 1 2 98 0 0 0 0 0 6863840 17424 553880 0 0 0 164 4532 8138 0 2 98 0 0 0 0 0 6863592 17432 554356 0 0 0 2192 4106 6809 0 1 98 0 0 And /proc/meminfo: -bash-3.1# cat /proc/meminfo MemTotal: 12464608 kB MemFree: 6945096 kB Buffers: 16732 kB Cached: 486116 kB SwapCached: 0 kB Active: 3929056 kB Inactive: 58056 kB HighTotal: 11655356 kB HighFree: 6889628 kB LowTotal: 809252 kB LowFree: 55468 kB SwapTotal: 2008116 kB SwapFree: 2008116 kB Dirty: 259036 kB Writeback: 0 kB AnonPages: 3484324 kB Mapped: 12016 kB Slab: 653076 kB PageTables: 773364 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 11979800 kB Committed_AS: 11642520 kB VmallocTotal: 116728 kB VmallocUsed: 9040 kB VmallocChunk: 107296 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 Hugepagesize: 2048 kB Raduisd.conf: Max_servers=32 Min_start_servers=32 min_spare_servers = 0 max_spare_servers = 32
Ali Majdzadeh wrote:
A while after radius up, it reports:
Sat Nov 26 13:02:03 2011 : Error: Couldn't fork /etc/netbill/acct.pl : Cannot allocate memory
Hmmm... you're probably using "exec wait', right? And starting many, many, external programs. That's probably the issue. There may be a bug in the server, but there is a better way to run the script. Use the rlm_perl module. Alan DeKok.
FYI: This is not a perl script. It’s a compiled C program. Just its extension is .pl! For more information: This is my module config: exec netbill_pre_auth{ wait = yes program = /etc/netbill/preauth.pl" input_pairs = request output_pairs = config packet_type = Access-Request } exec netbill_post_auth { wait = yes program = /etc/netbill/auth.pl" input_pairs = request output_pairs = reply packet_type = Access-Request } exec netbill_acct { wait = yes program = /etc/netbill/acct.pl" input_pairs = request output_pairs = reply packet_type = Accounting-Request } So I need to use with exec-wait becos the external programs need to wait util authentication/authorization/accounting done! Also plz note that auth.pl forks another exec program per authenticated user (named calc) and will live till user stopped. So if I’ve 20.000 online users, I’ve also 20.000 calc process. It works for about 20.000 online user and after this threshold, it stops! What is ur recommendation? Another Q: Is there any way to call nebtill_acct with wait=no? 2011/11/27 Alan DeKok <aland@deployingradius.com>
Ali Majdzadeh wrote:
A while after radius up, it reports:
Sat Nov 26 13:02:03 2011 : Error: Couldn't fork /etc/netbill/acct.pl : Cannot allocate memory
Hmmm... you're probably using "exec wait', right? And starting many, many, external programs.
That's probably the issue. There may be a bug in the server, but there is a better way to run the script. Use the rlm_perl module.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Mon, Nov 28, 2011 at 6:51 PM, Ali Majdzadeh <ali.majdzadeh@gmail.com> wrote:
Also plz note that auth.pl forks another exec program per authenticated user (named calc) and will live till user stopped. So if I’ve 20.000 online users, I’ve also 20.000 calc process.
The most obvious question is "why"? What happens if a user is never marked offline (e.g. acct-stop packet lost in network). Would that process keeps on living indefinitely? Seems like a design bug to me. There's probably a better solution for that if you can explain what the "calc" program does.
It works for about 20.000 online user and after this threshold, it stops!
What is ur recommendation?
Well, first of all, I'd actually recommend using 64bit OS (or at least 64bit kernel) if possible. My last experince with PAE was not so great. Second, what is "top" output (or better yet, htop) when you experience the error? Is some process (radiusd, perhaps) using close to 4GB virtual address space? Third, what does "ulimit -a" show? Might be that the limit is not memory at all, but open files or max user process. -- Fajar
Ali Majdzadeh wrote:
So I need to use with exec-wait becos the external programs need to wait util authentication/authorization/accounting done!
That is how exec-wait works.
Also plz note that auth.pl forks another exec program per authenticated user (named calc) and will live till user stopped. So if I’ve 20.000 online users, I’ve also 20.000 calc process.
That is very, very, bad. There is just no reason for it. Long-lived data goes into a database. That's what databases are for.
What is ur recommendation?
Design a solution that works. You are running into problems because your solution is wrong, and doesn't work. If you design a solution that works, you won't have these kind of problems.
Is there any way to call nebtill_acct with wait=no?
Set "wait = no" ? Alan DeKok.
participants (3)
-
Alan DeKok -
Ali Majdzadeh -
Fajar A. Nugraha