<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 17, 2014 at 11:25 PM, Iliya Peregoudov <span dir="ltr"><<a href="mailto:iperegudov@cboss.ru" target="_blank">iperegudov@cboss.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">rlm_perl had never spawn perl processes. rlm_perl embeds perl into the radiusd process space, so no inter-process communication is needed to call perl functions.<br>
<br>
rlm_perl in freeradius 1.1 uses pool of interpreters. radiusd thread take first unused interpreter from pool when rlm_perl is entered and put the interpreter back to the pool when rlm_perl is leaved.<br>
<br>
rlm_perl in freeradius 2.1 or higher uses interpreter per thread model. When the thread enters the rlm_perl for first time the interpreter is allocated and tied to the thread.<br>
<br>
Perl interpreter allocation is only used when perl library is compiled with USE_ITHREADS. If no USE_ITHREADS, then module is marked as thread unsafe when built. freeradius core ensures not to call rlm_perl instance in multiple threads simultaneously and rlm_perl instance uses single interpreter.<br>
<br>
If you want single rlm_perl instance to be called simultaneously from different thread you need perl built with USE_ITHREADS.<br>
<br>
However you can always call multiple rlm_perl instances simultaneously. Define multiple perl instances with same script, and call them from load-balance group:<br>
<br>
module pl1 {<br>
  module = ${confdir}/<a href="http://pl.pl" target="_blank">pl.pl</a><br>
}<br>
module pl2 {<br>
  module = ${confdir}/<a href="http://pl.pl" target="_blank">pl.pl</a><br>
}<br>
module pl3 {<br>
  module = ${confdir}/<a href="http://pl.pl" target="_blank">pl.pl</a><br>
}<br>
module pl4 {<br>
  module = ${confdir}/<a href="http://pl.pl" target="_blank">pl.pl</a><br>
}<br></blockquote><div><br></div><div>I'm having trouble getting the above syntax to work. I ended up trying out something like...</div><div><br></div><div>modules {</div><div>        perl perl1 {</div><div>                module = ${confdir}/perlscript</div><div>        }</div><div>        perl perl2 {</div><div>                module = ${confdir}/perlscript2</div><div>        } </div><div>}</div><div><br></div><div><div>accounting {</div><div>    load-balance {</div><div>            perl1</div><div>            perl2</div><div>    }</div><div>}</div></div><div><p class="">Both modules are initialized, but as far as I can tell only one perl interpreter is being used, using the second script/module perl2. The load balancing works, in that module perl1 and perl2 are called, but it seems like the two modules are using the same interpreter/script, where the last-defined perl module wins.</p><p class="">When I shutdown the server, I get strange messages indicating that the second script was loaded on top of the first one in the same interpreter.</p><p class="">







</p><p class="">Attempt to free non-existent shared string 'is_ERROR' during global destruction.</p><p class=""><br></p><p class="">Is this because I do not have multiplicity compiled? Or should I be able to have two unique instances of rlm_perl module with separate interpreters that do not conflict?<br></p></div><div>Any suggestions? I'm using 2.2.0</div><div><br></div><div>Thanks</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
authorize {<br>
  load-balance {<br>
    pl1 # 25% of requests go here<br>
    pl2<br>
    pl3<br>
    pl4<div class=""><div class="h5"><br>
  }<br>
}<br>
<br>
<br>
On 16.09.2014 22:20, Nick Rogers wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hello,<br>
<br>
I am hoping someone can clarify some questions I have about how rlm_perl<br>
should behave in FreeRADIUS 2.2.5 with respect to multiple instances and<br>
freeradius threads. I know there has been some discussion and<br>
changes/fixes to this behavior over the years, and I've been using<br>
rlm_perl successfully for nearly the last decade. Previously rlm_perl<br>
had its own "thread" pool, where multiple instances of the perl process<br>
would run simultaneously. Now I understand that rlm_perl uses the same<br>
freeradius thread management that everything else does.<br>
<br>
My problem is that my freeradius rlm_perl installation no longer spawns<br>
multiple instances of the perl process, effectively causing my server to<br>
be single threaded, which has begun to cause performance issues at some<br>
of my larger sites with increased load.<br>
<br>
I do not have perl with multiplicity or ithreads compiled, as this<br>
causes issues with other perl applications running on the same server.<br>
My question is, is there a way to support multiple instances of the<br>
rlm_perl interpreter without having ithreads or multiplicity compiled<br>
with perl?<br>
<br>
Is there a way for freeradius to simply launch a perl process for every<br>
freeradius server thread, instead of all threads relying on the same<br>
rlm_perl process? I am not interested in using perl threads or having<br>
multiple perl interpreters within the same perl process. I would really<br>
appreciate some clarification if this is possible or not.<br>
<br>
Thanks!<br>
<br>
-Nick<br>
</blockquote>
<br></div></div><div class=""><div class="h5">
-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/<u></u>list/users.html</a><br>
</div></div></blockquote></div><br></div></div>