Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F26A10802 for ; Wed, 4 Sep 2013 11:29:51 +0000 (UTC) Received: (qmail 76623 invoked by uid 500); 4 Sep 2013 11:29:51 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 76593 invoked by uid 500); 4 Sep 2013 11:29:51 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 76586 invoked by uid 99); 4 Sep 2013 11:29:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 11:29:50 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of elecharny@gmail.com designates 209.85.214.53 as permitted sender) Received: from [209.85.214.53] (HELO mail-bk0-f53.google.com) (209.85.214.53) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 11:29:45 +0000 Received: by mail-bk0-f53.google.com with SMTP id d7so94357bkh.40 for ; Wed, 04 Sep 2013 04:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=5m4jZD1mjdWzCRytn5RRuun78R1Q87Ogndpf9Autfu8=; b=cYPNLW/57kmdwxXxNmELa21cRVgpv/JIPAdtpZp3Elp523ll32gCFzlenMu0DSJOnZ G6zEA+ZtALeXyxMRjUP4rJR8hBBwLts8sj77ckSpFxPYmg1DqD91dJ+Sj0jxLRfcro9K +0a7nUowJxmc1wqcNu+gdNYuQCZ33Ed7xotnfdHNIcu0Xs5jMpirQfvnTKzxQ9YZtSQ1 FQXjmA4QIPfQZ4p23Sdexy2o4YOkTM3fYwduqaqiI11UDNzibJ8jPRuyM7NFw653Pnxx zJCBdTT9OF9UcoieJtzTf7xkWMXII/4Aj/UUyC8jt+oeGOz5h1cGtyGJ0UkJpH+vryWL XnNA== X-Received: by 10.204.65.9 with SMTP id g9mr1374114bki.33.1378294164498; Wed, 04 Sep 2013 04:29:24 -0700 (PDT) Received: from Emmanuels-MacBook-Pro.local (lon92-10-78-226-4-211.fbx.proxad.net. [78.226.4.211]) by mx.google.com with ESMTPSA id 14sm6262959bkl.17.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Sep 2013 04:29:23 -0700 (PDT) Message-ID: <52271993.5060303@gmail.com> Date: Wed, 04 Sep 2013 13:29:23 +0200 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Search performance potential improvements References: <5227077D.6030207@gmail.com> In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Le 9/4/13 1:27 PM, Kiran Ayyagari a écrit : > On Wed, Sep 4, 2013 at 3:42 PM, Emmanuel Lécharny wrote: > >> Hi guys, >> >> I just came back from a short week of excellent vacations, and I spent >> the last two days looking at the search operation. >> >> Just before I left, I thought that the entry was cloned for no reason. >> The fact is that we do modify the entry before returning it, so we must >> modify a copy of the cached entry, otherwise we can have some really >> nasty bugs in other parts (the entry is cached, so we can't simply >> modify it). >> >> OTOH, I discovered that we do a costly check in the >> DefaultSearchEngine.computeResults() method : we check if the search >> BaseDN is an alias by looking into the Alias index. Not doing this check >> imrpove the performance for around 15%. I'm pretty sure we can avoid >> looking into the index, as soon as we already have a cache of the >> existing aliases. The pb is that it's just a cache, and if the alias is >> not in the cache, we have to fetch the alias index. This become a pb >> when we have a lot of aliases, something unlikely to happen. >> >> how about setting a limit on the number of aliases that will be held in > the cache > and we store all the aliases in this cache, if the alias cache has less > than this limit we > don't need to look into the index (i.e we will always have all the aliases > in memory) > (here the assumption is that most server installations will have less > aliases than > the given threshold) Yes, this is probably the best solution. We just have to keep a counter of aliases beside the alias cache. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com