[SR-Users] app_perl persistent database connection
miconda at gmail.com
Mon Sep 15 19:09:33 CEST 2014
The answer to the question was: yes, after your question, in a dedicated
fhrase/paragraph. I expected you wanted to know if the perl script is
loaded at startup and then run from memory (precompiled form) at runtime
-- sparing another email to ask what you really mean by "constantly run
in background", which has different meaning in my understanding, but has
no relation with the purpose of Kamailio and its app_perl module.
The following remark (on separate paragraph) was an addition to say
that, if you need to refresh the the loaded perl script in memory, can
be done periodically if using upcoming 4.2. I added it, not strictly for
reloading the script in memory, but apparently perl was not designed for
long recursive running of scripts (or maybe developers of some libs
didn't have that in mind), resulting in system memory leak after long
interval of runing (reported by others, as I am not really using app_perl).
On 15/09/14 18:44, Vik Killa wrote:
> Interesting but could you elaborate on how that will answer my question?
> On Mon, Sep 15, 2014 at 11:44 AM, Daniel-Constantin Mierla
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
> On 15/09/14 17:03, Vik Killa wrote:
>> hello, does kamailio start/run the perl script defined by
>> modparam("app_perl", "filename", "/usr/local/test/bin/sips.pl
>> <http://sips.pl>") at startup and constantly run in background?
> The upcoming 4.2 has the option to reload the script (and reset
> the perl interpreter) periodically.
>> I want a persistent database connection rather than having to
>> constantly re-connect to database on each transaction.
>> Is this possible?
>> I'm connecting to postgres with
>> use DBI;
>> my $dsn = "DBI:Pg:database=$database;host=$host;port=$port";
>> my $dbh = DBI->connect($dsn, $user, $pass) || die "Could not
>> connect to database: $DBI::errstr";
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org>
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
> Next Kamailio Advanced Trainings 2014 -http://www.asipto.com
> Sep 22-25, Berlin, Germany
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
> sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org>
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the sr-users