You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Vijaya Dasari <vi...@zim.mpg.de> on 2003/11/14 11:12:34 UTC

Locks on sessions database

Hi,

We have problem with locking of rows in the session database. We are
using postgres as the Store.

Configuration of the system is Apache 2.0.47 + Embperl 2.0b9 + 
mod_perl 1.99_09

I tried using MySQL as Store, but still the same problem.

| 40 | sessions | localhost | sessions | Query   | 313  | User lock |
SELECT GET_LOCK('Apache-Session-30fac6623276e16798300d56c8de3989', 3600)
|
| 41 | sessions | localhost | sessions | Query   | 266  | User lock |
SELECT GET_LOCK('Apache-Session-30fac6623276e16798300d56c8de3989', 3600)
|

Two processes are trying to acquire a lock ( seems simultaneously ) on
the same session id (row).
We did not had this problem with Apache 1.3

I tried to use Semaphore combinations, but has the same problem.

Thanks in advance,
Vijaya.


-------------------------------------------
Vijaya Krishna Dasari
Heinz Nixdorf Zentrum fuer Informationsmanagement in der
Max-Planck-Gesellschaft (ZIM)
Phone:  +49-89-3299-1557
Fax: +49-89-3299-1555 
E-Mail: vid@zim.mpg.de
http: www.zim.mpg.de
Boltzmannstrasse 2/ITER Gebaeude 
D- 85748 Garching
GERMANY
-------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Locks on sessions database

Posted by Vijaya Dasari <vi...@zim.mpg.de>.
Hi, 

It was the problem with the Apache::DBI.

We were loading this Apache::DBI module along with other Perl modules
(used for the global variables).
These Perl modules access the database.

So when the apache starts the parent daemon, it already has connections
to the database(created by these perlmodules).

And we used httpd2-prefork, when apache creates forked processes these
connections (from Apache::DBI Connections) are also forked. And in this
way the same database connections are shared between the forked
processes and they are trying to access the session data (at the same
time) creating deadlocks.

We removed the preloading of modules in the apache parent daemon (from
httpd.conf) and it solved the problem.

So now I guess the Database connection pool (Apache::DBI) is created for
each forked process of the Apache.

Thanks,
Vijaya.


>-----Original Message-----
>From: Gerald Richter [mailto:richter@ecos.de]
>Sent: Saturday, November 15, 2003 2:59 PM
>To: Vijaya Dasari; embperl@perl.apache.org
>Subject: Re: Locks on sessions database
>
>Vijaya Dasari wrote:
>> Hi,
>>
>> We have problem with locking of rows in the session database. We are
>> using postgres as the Store.
>>
>
>How does your Embperl session configuration look like?
>
>Gerald
>
>
>> Configuration of the system is Apache 2.0.47 + Embperl 2.0b9 +
>> mod_perl 1.99_09
>>
>> I tried using MySQL as Store, but still the same problem.
>>
>>> 40 | sessions | localhost | sessions | Query   | 313  | User lock |
>> SELECT GET_LOCK('Apache-Session-30fac6623276e16798300d56c8de3989',
>> 3600)
>>>
>>> 41 | sessions | localhost | sessions | Query   | 266  | User lock |
>> SELECT GET_LOCK('Apache-Session-30fac6623276e16798300d56c8de3989',
>> 3600)
>>>
>>
>> Two processes are trying to acquire a lock ( seems simultaneously )
on
>> the same session id (row).
>> We did not had this problem with Apache 1.3
>>
>> I tried to use Semaphore combinations, but has the same problem.
>>
>> Thanks in advance,
>> Vijaya.
>>
>>
>> -------------------------------------------
>> Vijaya Krishna Dasari
>> Heinz Nixdorf Zentrum fuer Informationsmanagement in der
>> Max-Planck-Gesellschaft (ZIM)
>> Phone:  +49-89-3299-1557
>> Fax: +49-89-3299-1555
>> E-Mail: vid@zim.mpg.de
>> http: www.zim.mpg.de
>> Boltzmannstrasse 2/ITER Gebaeude
>> D- 85748 Garching
>> GERMANY
>> -------------------------------------------
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
>> For additional commands, e-mail: embperl-help@perl.apache.org
>
>--------------------------------------------------------------
>Gerald Richter     ecos electronic communication services gmbh
>IT-Securitylösungen * dynamische Webapplikationen * Consulting
>
>Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
>E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
>WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
>--------------------------------------------------------------
>|
>|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
>|
>+-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Locks on sessions database

Posted by Gerald Richter <ri...@ecos.de>.
Vijaya Dasari wrote:
> Hi,
>
> We have problem with locking of rows in the session database. We are
> using postgres as the Store.
>

How does your Embperl session configuration look like?

Gerald


> Configuration of the system is Apache 2.0.47 + Embperl 2.0b9 +
> mod_perl 1.99_09
>
> I tried using MySQL as Store, but still the same problem.
>
>> 40 | sessions | localhost | sessions | Query   | 313  | User lock |
> SELECT GET_LOCK('Apache-Session-30fac6623276e16798300d56c8de3989',
> 3600)
>>
>> 41 | sessions | localhost | sessions | Query   | 266  | User lock |
> SELECT GET_LOCK('Apache-Session-30fac6623276e16798300d56c8de3989',
> 3600)
>>
>
> Two processes are trying to acquire a lock ( seems simultaneously ) on
> the same session id (row).
> We did not had this problem with Apache 1.3
>
> I tried to use Semaphore combinations, but has the same problem.
>
> Thanks in advance,
> Vijaya.
>
>
> -------------------------------------------
> Vijaya Krishna Dasari
> Heinz Nixdorf Zentrum fuer Informationsmanagement in der
> Max-Planck-Gesellschaft (ZIM)
> Phone:  +49-89-3299-1557
> Fax: +49-89-3299-1555
> E-Mail: vid@zim.mpg.de
> http: www.zim.mpg.de
> Boltzmannstrasse 2/ITER Gebaeude
> D- 85748 Garching
> GERMANY
> -------------------------------------------
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org