Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 13347 invoked from network); 20 Nov 2008 20:55:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2008 20:55:35 -0000 Received: (qmail 48302 invoked by uid 500); 20 Nov 2008 20:55:43 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 48277 invoked by uid 500); 20 Nov 2008 20:55:43 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 48268 invoked by uid 99); 20 Nov 2008 20:55:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Nov 2008 12:55:43 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Nov 2008 20:54:29 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 47751234C297 for ; Thu, 20 Nov 2008 12:54:44 -0800 (PST) Message-ID: <1845465691.1227214484291.JavaMail.jira@brutus> Date: Thu, 20 Nov 2008 12:54:44 -0800 (PST) From: "Maarten Coene (JIRA)" To: notifications@ant.apache.org Subject: [jira] Commented: (IVY-973) [PATCH] SFTP repositories become very slow after a while In-Reply-To: <62936824.1227089384645.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IVY-973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12649483#action_12649483 ] Maarten Coene commented on IVY-973: ----------------------------------- I think your patch will only work if you don't have a [revision] token in your directory structure. Can you confirm this is the case in your situation? So if your pattern looks like for instance "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]", you'll still have a roundtrip for each revision. I think we should try to avoid calling Resource.exists() in the ResolverHelper.findAll() method. > [PATCH] SFTP repositories become very slow after a while > -------------------------------------------------------- > > Key: IVY-973 > URL: https://issues.apache.org/jira/browse/IVY-973 > Project: Ivy > Issue Type: Improvement > Components: Core > Affects Versions: 2.0-RC2 > Reporter: Johannes Rudolph > Priority: Minor > Attachments: faster-sftp.patch > > > If many versions of a module live in a folder of an SFTP repository each resolve for dynamic versions becomes dreadfully slow because a roundtrip to the server is made to the server for every version which lies on the server. > The call sequence goes like that: > org.apache.ivy.plugins.resolver.util.ResolverHelper.findAll calls > 1. org.apache.ivy.plugins.resolver.util.ResolverHelper.listTokenValues which calls > SFTPRepository.list with the directory of the module as parameter (1. roundtrip) > 2. for every found file matching the pattern SFTPRepository.getResource(path).exists() > In turn SFTPResource tries to initialize itself and calls SFTPRepository.resolveResource which does the second roundtrip to the server - for every version of the file > Example: Having 20 versions of a module in a repository which is a roundtrip of 150ms away, leads to a lag of 20 * 150ms = 3s . Multiply that with any module having a dynamic version. > The solution is to cache all the resources in SFTPRepository. You can use the information retrieved when calling SFTPRepository.list to fill the cache in advance. > The disadvantage is that you may have stale data. IMO this is mostly no problem because every call to list updates the cache and files already available in the repository won't hopefully change any metadata in the time between. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.