Return-Path: X-Original-To: apmail-mahout-user-archive@www.apache.org Delivered-To: apmail-mahout-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B31CD6351 for ; Thu, 21 Jul 2011 12:40:53 +0000 (UTC) Received: (qmail 2357 invoked by uid 500); 21 Jul 2011 12:40:52 -0000 Delivered-To: apmail-mahout-user-archive@mahout.apache.org Received: (qmail 2156 invoked by uid 500); 21 Jul 2011 12:40:52 -0000 Mailing-List: contact user-help@mahout.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@mahout.apache.org Delivered-To: mailing list user@mahout.apache.org Received: (qmail 2148 invoked by uid 99); 21 Jul 2011 12:40:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 12:40:51 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ciric.marko@gmail.com designates 209.85.214.170 as permitted sender) Received: from [209.85.214.170] (HELO mail-iw0-f170.google.com) (209.85.214.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 12:40:46 +0000 Received: by iwn36 with SMTP id 36so1899092iwn.1 for ; Thu, 21 Jul 2011 05:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ppGHWYTXm8d7kinXB8ZhoDqtDkNGBTl7PqxyiwJqg60=; b=K3ptRH3RTSX+HDYopcNy2abpYF0arNysSVz2HxMnAw7HgxXresyELoG5rUF2haIIfJ qna2TVnJZWZUPjpz3Uf8mEKGiPVhvyyh8IzUwZCHYycnD+8jK6AzkY8QNp5j0QFLEkOR 2kRfOSY5kKlRKHSBzPObQgkDtzy6ntebjAbek= MIME-Version: 1.0 Received: by 10.142.201.11 with SMTP id y11mr90384wff.179.1311252025923; Thu, 21 Jul 2011 05:40:25 -0700 (PDT) Received: by 10.142.153.19 with HTTP; Thu, 21 Jul 2011 05:40:25 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Jul 2011 14:40:25 +0200 Message-ID: Subject: Re: Connection Pooling From: Marko Ciric To: user@mahout.apache.org Content-Type: multipart/alternative; boundary=000e0cd32a9a37590e04a893a75e --000e0cd32a9a37590e04a893a75e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Actually, as GenericDataModel class works very well as a super class of you= r desired data model. This way everything is cached into memory and boosts performance a lot. The reloading is actually easy to be implemented with th= e refresh mechanism (Taste objects implement Refreshable interface). You can also try RefreshHelper. On 13 July 2011 20:58, Sean Owen wrote: > I was mixing this up with another class. It doesn't reload itself. You ca= n > call refresh() to do so. > > On Wed, Jul 13, 2011 at 7:34 PM, Salil Apte wrote= : > > > Where can the interval be configured? BTW, ReloadFromJDBCDataModel > > works like a dream so far :) > > > > On Wed, Jul 13, 2011 at 10:58 AM, Sean Owen wrote: > > > Yes it reloads after a configurable interval, or on demand. > > > > > > Clearing the cache for a user ID only means that user's data is > > recomputed. > > > It's not bad to call this frequently per se... I suppose you want to > let > > it > > > cache as much and for as long as is valid and acceptable to your app. > > > > > > Your bottleneck is no longer reading from the DB if you're having it > load > > > into memory. > > > > > > On Wed, Jul 13, 2011 at 6:19 PM, Salil Apte > > wrote: > > > > > >> Awesome, I will give ReloadFromJDBCDataModel a try. How does this > > >> particular data model update itself on database changes? Does it jus= t > > >> happen periodically and if so, can this rate be change easily? > > >> > > >> Lastly, will calling clear(userId) on a recommender frequently be ba= d > > >> for performance? I'm assuming with such small data amounts that the > > >> actual recommendation algorithm is quite speedy and that the DB is > > >> really the big bottleneck? > > >> > > >> On Wed, Jul 13, 2011 at 2:11 AM, Sean Owen wrote: > > >> > That's all correct, it reads a lot. But you can avoid a lot of it = by > > >> using > > >> > caching wrappers. > > >> > You also don't need to dump to a file. Use ReloadFromJDBCDataModel= . > > >> > > > >> > On Wed, Jul 13, 2011 at 9:57 AM, Vitali Mogilevsky > > >> > wrote: > > >> > > > >> >> Hey, > > >> >> I got the same problem, of slowness while using MYSQL data model, > > after > > >> a > > >> >> small research and looking into mysql's query log, revealed that > user > > - > > >> >> user > > >> >> recommendation just floods the database with thousands and > thousands > > of > > >> >> requests. > > >> >> and thats on small database. > > >> >> for now Im dumbping the database into file, and using filedata > model > > >> which > > >> >> works much faster > > >> >> > > >> >> > > >> > > > >> > > > > > > --=20 -- Marko =C4=86iri=C4=87 ciric.marko@gmail.com --000e0cd32a9a37590e04a893a75e--