Mailing List Archive

Slow query against AD
Hi all

I install DAViCal with partial sucess on ubuntu server 9.04

However, when I enable AD authentication, login to admin pages is very
slow, about almost 20 seconds...

Also, when I create a new event is too slow, about 20-30 seconds...
Delete events too...

Perhaps I do something wrong...
That is my config file:

<?php
$c->domain_name = 'selbetti.com.br';
$c->sysabbr = 'davical';
$c->system_name = 'DAViCal CalDAV Server';
$c->admin_email = 'gilberto.nunes at selbetti.com.br';
$c->pg_connect[] = 'dbname=davical user=davical_app';
$c->authenticate_hook['call'] = 'LDAP_check';
$c->authenticate_hook['config'] = array(
'host' => 'ldap://192.168.200.2',
'bindDN' => 'cn=proxy_user,ou=Internet,dc=selbetti,dc=local',
'passDN' => 'my-pass-here',
'baseDNUsers' => 'dc=selbetti,dc=local',
'protocolVersion' => 3,
'optReferrels' => 0,
'filterUsers' => '(&(objectclass=person)(objectclass=user))',
'mapping_field' => array("username" => "sAMAccountName",
"fullname" => "cn" ,
"email" =>"mail"),
'default_value' => array("date_format_type" => "E","locale" =>
"en_NZ"),
'format_updated'=> array('Y' => array(0,4),
'm' => array(4,2),
'd' => array(6,2),
'H' => array(8,2),
'M' => array(10,2),
'S' => array(12,2)),

);
include_once('drivers_ldap.php');
$c->dbg["ALL"] = 1;

I put the last line to send some logs to /var/log/syslog, but nothing
that I see help me...

I somebody can help, I will very appreciate....

Thanks

--
*Gilberto Nunes Ferreira*
*TI*
*Selbetti Gest?o de Documentos*
*Telefone: +55 (47) 3441-6004*
*Celular: +55 (47) 8861-6672*



/"Bendita a na??o cujo Deus ? o SENHOR!"/
*99* <><
Slow query against AD [ In reply to ]
Is there somebody here that know this issue?!!

Thanks
*Gilberto Nunes Ferreira*
*TI*
*Selbetti Gest?o de Documentos*
*Telefone: +55 (47) 3441-6004*
*Celular: +55 (47) 8861-6672*



/"Bendita a na??o cujo Deus ? o SENHOR!"/
*99* <><



gilberto nunes escreveu:
> Hi all
>
> I install DAViCal with partial sucess on ubuntu server 9.04
>
> However, when I enable AD authentication, login to admin pages is very
> slow, about almost 20 seconds...
>
> Also, when I create a new event is too slow, about 20-30 seconds...
> Delete events too...
>
> Perhaps I do something wrong...
> That is my config file:
>
> <?php
> $c->domain_name = 'selbetti.com.br';
> $c->sysabbr = 'davical';
> $c->system_name = 'DAViCal CalDAV Server';
> $c->admin_email = 'gilberto.nunes at selbetti.com.br';
> $c->pg_connect[] = 'dbname=davical user=davical_app';
> $c->authenticate_hook['call'] = 'LDAP_check';
> $c->authenticate_hook['config'] = array(
> 'host' => 'ldap://192.168.200.2',
> 'bindDN' => 'cn=proxy_user,ou=Internet,dc=selbetti,dc=local',
> 'passDN' => 'my-pass-here',
> 'baseDNUsers' => 'dc=selbetti,dc=local',
> 'protocolVersion' => 3,
> 'optReferrels' => 0,
> 'filterUsers' => '(&(objectclass=person)(objectclass=user))',
> 'mapping_field' => array("username" => "sAMAccountName",
> "fullname" => "cn" ,
> "email" =>"mail"),
> 'default_value' => array("date_format_type" => "E","locale" =>
> "en_NZ"),
> 'format_updated'=> array('Y' => array(0,4),
> 'm' => array(4,2),
> 'd' => array(6,2),
> 'H' => array(8,2),
> 'M' => array(10,2),
> 'S' => array(12,2)),
>
> );
> include_once('drivers_ldap.php');
> $c->dbg["ALL"] = 1;
>
> I put the last line to send some logs to /var/log/syslog, but nothing
> that I see help me...
>
> I somebody can help, I will very appreciate....
>
> Thanks
>
>
Slow query against AD [ In reply to ]
gilberto nunes wrote:
> Is there somebody here that know this issue?!!
>

I don't think we are many to use AD so we don't have the trouble you mention, and AD is more difficult to install.

Do your maximum to provide perharps a precise version of AD 2000/2003/2008 & sub version R1-R2

The debug log you have mention are not normally going to syslog but on php_error.log which you must activate
(if you use php_error = 0 you would see nothing)

The community is also dispatched around the world, so sometime you just have to wait someone could be awake.
(Don't forget it's the ThankGiving break this week-end so many US people also are going away to see their familly)


--

Bruno Friedmann
Slow query against AD [ In reply to ]
On 27/11/09 23:05, gilberto nunes wrote:
> Hi all
>
> I install DAViCal with partial sucess on ubuntu server 9.04
>
> However, when I enable AD authentication, login to admin pages is very
> slow, about almost 20 seconds...
>
> Also, when I create a new event is too slow, about 20-30 seconds...
> Delete events too...
>
> Perhaps I do something wrong...
> That is my config file:
>
> <?php
> $c->domain_name = 'selbetti.com.br';
> $c->sysabbr = 'davical';
> $c->system_name = 'DAViCal CalDAV Server';
> $c->admin_email = 'gilberto.nunes at selbetti.com.br';
> $c->pg_connect[] = 'dbname=davical user=davical_app';
> $c->authenticate_hook['call'] = 'LDAP_check';
> $c->authenticate_hook['config'] = array(
> 'host' => 'ldap://192.168.200.2',
> 'bindDN' => 'cn=proxy_user,ou=Internet,dc=selbetti,dc=local',
> 'passDN' => 'my-pass-here',
> 'baseDNUsers' => 'dc=selbetti,dc=local',
> 'protocolVersion' => 3,
> 'optReferrels' => 0,
> 'filterUsers' => '(&(objectclass=person)(objectclass=user))',
> 'mapping_field' => array("username" => "sAMAccountName",
> "fullname" => "cn" ,
> "email" =>"mail"),
> 'default_value' => array("date_format_type" => "E","locale" =>
> "en_NZ"),
> 'format_updated'=> array('Y' => array(0,4),
> 'm' => array(4,2),
> 'd' => array(6,2),
> 'H' => array(8,2),
> 'M' => array(10,2),
> 'S' => array(12,2)),
>
> );
> include_once('drivers_ldap.php');
> $c->dbg["ALL"] = 1;
>
> I put the last line to send some logs to /var/log/syslog, but nothing
> that I see help me...
>
While it isn't recommended to enable that level of debugging, you should
be able to see from that that it will be almost entirely the AD query
that is taking that time.

If you query AD from the command line on that server does it also take
20 seconds? I wonder if there are DNS issues or something like that.
Perhaps your resolv.conf is pointing first to an invalid nameserver, so
you get a DNS timeout before resolving the nameserver name.

Regards,
Andrew McMillan.
> I somebody can help, I will very appreciate....
>
> Thanks
>
>


--
------------------------------------------------------------------------
http://andrew.mcmillan.net.nz/ Porirua, New Zealand
Twitter: _karora Phone: +64(272)DEBIAN
Communicate! It can't make things any worse.
------------------------------------------------------------------------
Slow query against AD [ In reply to ]
Hi

My postgresql version is 8.3
I do vacuum, but is not effect anyway...
The loggein still slow...

Thanks


*Gilberto Nunes Ferreira*
*TI*
*Selbetti Gest?o de Documentos*
*Telefone: +55 (47) 3441-6004*
*Celular: +55 (47) 8861-6672*



/"Bendita a na??o cujo Deus ? o SENHOR!"/
*99* <><



Andrew McMillan escreveu:
> On Mon, 2009-11-30 at 08:24 -0200, gilberto nunes wrote:
>
>> Hi
>>
>> I run ldapsearch from "shell" with time command and get this time:
>>
>> real 0m3.946s
>> user 0m0.180s
>> sys 0m0.180s
>>
>> This is the line command that I use:
>>
>> ldapsearch -x -b "dc=selbetti,dc=local" -D
>> "cn=proxy_user,ou=Internet,dc=selbetti,dc=local" -h ricoh -p 389 -W
>>
>> So, I suppose that there is any problem with DNS resolv...
>>
>
> 4 seconds for a response to the LDAP query seems pretty excessive. I
> think that the LDAP auth may do several queries, although I doubt it
> would be more than 3.
>
> Another test you could try is to restart the postgresql database server
> and vacuum the database:
>
> sudo -i
>
> # As root
> /etc/init.d/postgresql-8.3 stop
> /etc/init.d/postgresql-8.3 start
> su - postgres
>
> # As postgres
> psql davical
>
> # in psql
> davical=# vacuum full analyze;
> davical=# \q
>
>
> I have heard of situations in the past where there are many dead rows in
> the database due to autovacuum not running for a long time, and this
> will fix that. It is important to actually stop & start the postgres
> database before doing this to ensure there are no long-running
> transactions complicating the issue.
>
> I've not heard of this problem happening with versions later than
> PostgreSQL 8.1 so it would be good to know if it is the case, and what
> Pg version you have.
>
> Regards,
> Andrew.
>
>
>> Thanks
>>
>>
>> *Gilberto Nunes Ferreira*
>> *TI*
>> *Selbetti Gest?o de Documentos*
>> *Telefone: +55 (47) 3441-6004*
>> *Celular: +55 (47) 8861-6672*
>>
>>
>>
>> /"Bendita a na??o cujo Deus ? o SENHOR!"/
>> *99* <><
>>
>>
>>
>> Andrew McMillan escreveu:
>>
>>> On 27/11/09 23:05, gilberto nunes wrote:
>>>
>>>> Hi all
>>>>
>>>> I install DAViCal with partial sucess on ubuntu server 9.04
>>>>
>>>> However, when I enable AD authentication, login to admin pages is very
>>>> slow, about almost 20 seconds...
>>>>
>>>> Also, when I create a new event is too slow, about 20-30 seconds...
>>>> Delete events too...
>>>>
>>>> Perhaps I do something wrong...
>>>> That is my config file:
>>>>
>>>> <?php
>>>> $c->domain_name = 'selbetti.com.br';
>>>> $c->sysabbr = 'davical';
>>>> $c->system_name = 'DAViCal CalDAV Server';
>>>> $c->admin_email = 'gilberto.nunes at selbetti.com.br';
>>>> $c->pg_connect[] = 'dbname=davical user=davical_app';
>>>> $c->authenticate_hook['call'] = 'LDAP_check';
>>>> $c->authenticate_hook['config'] = array(
>>>> 'host' => 'ldap://192.168.200.2',
>>>> 'bindDN' =>
>>>> 'cn=proxy_user,ou=Internet,dc=selbetti,dc=local',
>>>> 'passDN' => 'my-pass-here',
>>>> 'baseDNUsers' => 'dc=selbetti,dc=local',
>>>> 'protocolVersion' => 3,
>>>> 'optReferrels' => 0,
>>>> 'filterUsers' =>
>>>> '(&(objectclass=person)(objectclass=user))',
>>>> 'mapping_field' => array("username" => "sAMAccountName",
>>>> "fullname" => "cn" ,
>>>> "email" =>"mail"),
>>>> 'default_value' => array("date_format_type" => "E","locale" =>
>>>> "en_NZ"),
>>>> 'format_updated'=> array('Y' => array(0,4),
>>>> 'm' => array(4,2),
>>>> 'd' => array(6,2),
>>>> 'H' => array(8,2),
>>>> 'M' => array(10,2),
>>>> 'S' => array(12,2)),
>>>>
>>>> );
>>>> include_once('drivers_ldap.php');
>>>> $c->dbg["ALL"] = 1;
>>>>
>>>> I put the last line to send some logs to /var/log/syslog, but nothing
>>>> that I see help me...
>>>>
>>>>
>>> While it isn't recommended to enable that level of debugging, you
>>> should be able to see from that that it will be almost entirely the AD
>>> query that is taking that time.
>>>
>>> If you query AD from the command line on that server does it also take
>>> 20 seconds? I wonder if there are DNS issues or something like that.
>>> Perhaps your resolv.conf is pointing first to an invalid nameserver,
>>> so you get a DNS timeout before resolving the nameserver name.
>>>
>>> Regards,
>>> Andrew McMillan.
>>>
>>>> I somebody can help, I will very appreciate....
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>
>
>
> ------------------------------------------------------------------------
> andrew (AT) morphoss (DOT) com +64(272)DEBIAN
> You recoil from the crude; you tend naturally toward the exquisite.
> ------------------------------------------------------------------------
>
>
Slow query against AD [ In reply to ]
On Tue, 2009-12-01 at 08:12 -0200, gilberto nunes wrote:
> Hi
>
> My postgresql version is 8.3
> I do vacuum, but is not effect anyway...
> The loggein still slow...

OK.

I think your best chance is to ask 'who else is using AD successfully'
on the mailing list, and maybe you can work together to solve the issue.

Unfortunately I know little about LDAP or AD - this is user contributed
code, and it is something of a black box to me. Can you debug PHP at
all? Put some statements around the authentication process and see what
strange thing might be happening in there...?

Regards,
Andrew.


> Thanks
>
>
> *Gilberto Nunes Ferreira*
> *TI*
> *Selbetti Gest?o de Documentos*
> *Telefone: +55 (47) 3441-6004*
> *Celular: +55 (47) 8861-6672*
>
>
>
> /"Bendita a na??o cujo Deus ? o SENHOR!"/
> *99* <><
>
>
>
> Andrew McMillan escreveu:
> > On Mon, 2009-11-30 at 08:24 -0200, gilberto nunes wrote:
> >
> >> Hi
> >>
> >> I run ldapsearch from "shell" with time command and get this time:
> >>
> >> real 0m3.946s
> >> user 0m0.180s
> >> sys 0m0.180s
> >>
> >> This is the line command that I use:
> >>
> >> ldapsearch -x -b "dc=selbetti,dc=local" -D
> >> "cn=proxy_user,ou=Internet,dc=selbetti,dc=local" -h ricoh -p 389 -W
> >>
> >> So, I suppose that there is any problem with DNS resolv...
> >>
> >
> > 4 seconds for a response to the LDAP query seems pretty excessive. I
> > think that the LDAP auth may do several queries, although I doubt it
> > would be more than 3.
> >
> > Another test you could try is to restart the postgresql database server
> > and vacuum the database:
> >
> > sudo -i
> >
> > # As root
> > /etc/init.d/postgresql-8.3 stop
> > /etc/init.d/postgresql-8.3 start
> > su - postgres
> >
> > # As postgres
> > psql davical
> >
> > # in psql
> > davical=# vacuum full analyze;
> > davical=# \q
> >
> >
> > I have heard of situations in the past where there are many dead rows in
> > the database due to autovacuum not running for a long time, and this
> > will fix that. It is important to actually stop & start the postgres
> > database before doing this to ensure there are no long-running
> > transactions complicating the issue.
> >
> > I've not heard of this problem happening with versions later than
> > PostgreSQL 8.1 so it would be good to know if it is the case, and what
> > Pg version you have.
> >
> > Regards,
> > Andrew.
> >
> >
> >> Thanks
> >>
> >>
> >> *Gilberto Nunes Ferreira*
> >> *TI*
> >> *Selbetti Gest?o de Documentos*
> >> *Telefone: +55 (47) 3441-6004*
> >> *Celular: +55 (47) 8861-6672*
> >>
> >>
> >>
> >> /"Bendita a na??o cujo Deus ? o SENHOR!"/
> >> *99* <><
> >>
> >>
> >>
> >> Andrew McMillan escreveu:
> >>
> >>> On 27/11/09 23:05, gilberto nunes wrote:
> >>>
> >>>> Hi all
> >>>>
> >>>> I install DAViCal with partial sucess on ubuntu server 9.04
> >>>>
> >>>> However, when I enable AD authentication, login to admin pages is very
> >>>> slow, about almost 20 seconds...
> >>>>
> >>>> Also, when I create a new event is too slow, about 20-30 seconds...
> >>>> Delete events too...
> >>>>
> >>>> Perhaps I do something wrong...
> >>>> That is my config file:
> >>>>
> >>>> <?php
> >>>> $c->domain_name = 'selbetti.com.br';
> >>>> $c->sysabbr = 'davical';
> >>>> $c->system_name = 'DAViCal CalDAV Server';
> >>>> $c->admin_email = 'gilberto.nunes at selbetti.com.br';
> >>>> $c->pg_connect[] = 'dbname=davical user=davical_app';
> >>>> $c->authenticate_hook['call'] = 'LDAP_check';
> >>>> $c->authenticate_hook['config'] = array(
> >>>> 'host' => 'ldap://192.168.200.2',
> >>>> 'bindDN' =>
> >>>> 'cn=proxy_user,ou=Internet,dc=selbetti,dc=local',
> >>>> 'passDN' => 'my-pass-here',
> >>>> 'baseDNUsers' => 'dc=selbetti,dc=local',
> >>>> 'protocolVersion' => 3,
> >>>> 'optReferrels' => 0,
> >>>> 'filterUsers' =>
> >>>> '(&(objectclass=person)(objectclass=user))',
> >>>> 'mapping_field' => array("username" => "sAMAccountName",
> >>>> "fullname" => "cn" ,
> >>>> "email" =>"mail"),
> >>>> 'default_value' => array("date_format_type" => "E","locale" =>
> >>>> "en_NZ"),
> >>>> 'format_updated'=> array('Y' => array(0,4),
> >>>> 'm' => array(4,2),
> >>>> 'd' => array(6,2),
> >>>> 'H' => array(8,2),
> >>>> 'M' => array(10,2),
> >>>> 'S' => array(12,2)),
> >>>>
> >>>> );
> >>>> include_once('drivers_ldap.php');
> >>>> $c->dbg["ALL"] = 1;
> >>>>
> >>>> I put the last line to send some logs to /var/log/syslog, but nothing
> >>>> that I see help me...
> >>>>
> >>>>
> >>> While it isn't recommended to enable that level of debugging, you
> >>> should be able to see from that that it will be almost entirely the AD
> >>> query that is taking that time.
> >>>
> >>> If you query AD from the command line on that server does it also take
> >>> 20 seconds? I wonder if there are DNS issues or something like that.
> >>> Perhaps your resolv.conf is pointing first to an invalid nameserver,
> >>> so you get a DNS timeout before resolving the nameserver name.
> >>>
> >>> Regards,
> >>> Andrew McMillan.
> >>>
> >>>> I somebody can help, I will very appreciate....
> >>>>
> >>>> Thanks
> >>>>
> >>>>
> >>>>
> >>>
> >
> >
> > ------------------------------------------------------------------------
> > andrew (AT) morphoss (DOT) com +64(272)DEBIAN
> > You recoil from the crude; you tend naturally toward the exquisite.
> > ------------------------------------------------------------------------
> >
> >
>


------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
If you sow your wild oats, hope for a crop failure.
------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20091201/3537404c/attachment.pgp>
-------------- next part --------------