Permanent mysql connection in mod_perl
Apostolos Pantsiopoulos
regs at kinetix.gr
Wed Apr 7 11:35:14 CEST 2010
Yes,
remeber to include the initiation of the handler outside the function
(global for the script). i.e. :
...
my $dbh;
sub CLONE(){
$dbh = DBI->connect...
}
...
(the rest of your functions which use the $dbh handler)
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs at kinetix.gr
-------------------------------------------
On 7/4/2010 12:27 μμ, Nasser Heidari wrote:
>
>> -----Original Message-----
>> From: freeradius-users-bounces+nasser=rasana.net at lists.freeradius.org
>> [mailto:freeradius-users-bounces+nasser=rasana.net at lists.freeradius.org]
>> On Behalf Of Apostolos Pantsiopoulos
>> Sent: Wednesday, April 07, 2010 13:37
>> To: freeradius-users at lists.freeradius.org
>> Subject: Re: Permanent mysql connection in mod_perl
>>
>> Have a look at the CLONE special function in rlm_perl documentation.
>> Initiate your db connections in that function.
>>
>
>
> Unfortunately I'm not familiar with this function, as I have searched , I think that only change that I need is to enclose my db connection part in Perl script into sub CLONE {} .
> Is that correct?
>
>> --
>> -------------------------------------------
>> Apostolos Pantsiopoulos
>> Kinetix Tele.com R& D
>> email: regs at kinetix.gr
>> -------------------------------------------
>>
>> On 7/4/2010 12:01 μμ, Nasser Heidari wrote:
>>> Hi,
>>> I'm using mod_perl in my radius configuration and using it I write some
>>> logs to database.
>>> Today I noticed that, there are lots of mysql connections in TIME_WAIT
>>> state.
>>>
>>> # netstat -epn --tcp | grep TIME_WAIT | wc -l
>>> 15015
>>>
>>> netstat -epn --tcp | grep TIME_WAIT | tail -1
>>> tcp 0 0 192.168.1.4:49060 192.168.1.6:3306 TIME_WAIT
>>>
>>> I'm sure it is because of mod_perl, and I'm looking forward to force
>>> radius to use permanent mysql connections.
>>> Has anyone any idea?
>>>
>>> Thanks in advance
>>>
>>>
>>> -
>>> List info/subscribe/unsubscribe? See
>> http://www.freeradius.org/list/users.html
>> -
>> List info/subscribe/unsubscribe? See
>> http://www.freeradius.org/list/users.html
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list