热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

查询svn版本突然变得很慢(因为svn1.5可能?)-Queryingforsvnrevisionsuddenlyseemsslow(sincesvn1.5maybe?)

ShortlyafterupgradingourrepositorytoSubversion1.5,myteamswitchedtowritinganewapplicat

Shortly after upgrading our repository to Subversion 1.5, my team switched to writing a new application for a few months and then abruptly returned to our original codebase. Our developers are using TortoiseSVN 1.5.9 and Subversion Client 1.6 (only for svnversion -n) and Subversion 1.5 on our server. Our clients connect via svn+ssh.

在将我们的存储库升级到Subversion 1.5之后不久,我的团队开始编写一个新应用程序几个月,然后突然返回到我们原来的代码库。我们的开发人员在我们的服务器上使用TortoiseSVN 1.5.9和Subversion Client 1.6(仅适用于svnversion -n)和Subversion 1.5。我们的客户通过svn + ssh连接。

Our original codebase integrates the SVN revision number into the code using svnversion -n to query for the WC's current revision. Suddenly however, this operation has gone to what I recall taking a short second or two to as long as 10s (and I've seen worse still inside of VM development environments, etc.) We've also experienced similar delays going back and experimenting with Tortoise's SubWCRev and Subversion Client 1.5.

我们的原始代码库使用svnversion -n将SVN修订版号集成到代码中,以查询WC的当前版本。然而,突然之间,这个操作已经发生了我记得短暂的一两秒到10秒(我在VM开发环境中看到更糟糕的情况等等)我们也遇到过类似的延迟和实验使用Tortoise的SubWCRev和Subversion Client 1.5。

This is not a massive problem but it is certainly an annoyance as this check is made as a pre-compile step before every build operation. As such, I'd love iron those few seconds out of our feedback loop!

这不是一个大问题,但它肯定是一个烦恼,因为这个检查是在每个构建操作之前作为预编译步骤。因此,我喜欢在我们的反馈循环中花几秒钟!

So, my question: Have I simply been away from my old codebase too long or has anyone else noticed a delay for this operation?

所以,我的问题是:我是否只是远离我的旧代码库太长时间或者是否有其他人注意到此操作的延迟?

If this delay is a new phenomena, has anyone fixed it. If so, how?

如果这种延迟是一种新现象,有人修复它。如果是这样,怎么样?

4 个解决方案

#1


In the highly recommended red-bean svn book they state that large commits (many files in one commit) can greatly impact performance. Did you check in a large number of files recently, say in the last 100 check ins?

在强烈推荐的red-bean svn书中,他们声明大型提交(一次提交中的许多文件)会极大地影响性能。您最近是否在最近100次检查中检入了大量文件?

#2


I agree with John Weldon. If you are using Apache (http(s)) then there is the possibility to slow down your svn log command. This happens on commits with a lot of filepaths changed/added. One solution is to remove path based authorisation or remove the particular revision. See for a more details here:

我同意约翰威尔登的观点。如果您使用的是Apache(http(s)),则可以减慢svn log命令的速度。这种情况发生在更改/添加了大量文件路径的提交中。一种解决方案是删除基于路径的授权或删除特定修订。有关详细信息,请参阅此处:

All of this path checking can sometimes be quite expensive, especially in the case of svn log. When retrieving a list of revisions, the server looks at every changed path in each revision and checks it for readability. [...]Needless to say, this can be time-consuming on revisions that affect a large number of files. This is the cost of security: even if you haven't configured a module such as mod_authz_svn at all, the mod_dav_svn module is still asking Apache httpd to run authorization checks on every path.

所有这些路径检查有时可能非常昂贵,尤其是在svn log的情况下。检索修订列表时,服务器会查看每个修订中的每个更改路径并检查其是否可读。 [...]毋庸置疑,对于影响大量文件的修订,这可能非常耗时。这是安全成本:即使您还没有配置mod_authz_svn之类的模块,mod_dav_svn模块仍然要求Apache httpd在每个路径上运行授权检查。

#3


I just solved a problem like this on my server. What are you using for auth? A checkout, commit, or log operation is a series of several HTTP requests. In the case of a log display, it's hundreds. If you have an auth layer there, it will be auth'ing on every request. If you're authing against a slow back-end that will slow you down. In my case, we were authing against our IMAP server (a custom mod_auth_imap). Once I added caching to the auth layer (keep hash user/pass pairs around for sixty seconds) it drastically sped things up: checkouts used to take 1.5 minutes and now took three seconds.

我刚在服务器上解决了这样的问题。你用什么认证?结帐,提交或日志操作是一系列多个HTTP请求。在日志显示的情况下,它是数百。如果你有一个auth层,它将在每个请求上进行身份验证。如果你正在对一个缓慢的后端进行打算,这会减慢你的速度。就我而言,我们正在针对我们的IMAP服务器进行authing(自定义mod_auth_imap)。一旦我将缓存添加到auth层(保持哈希用户/传递对60秒),它就会大大加快速度:签出过去需要1.5分钟,现在需要3秒钟。

#4


Within (correctly configured) zsh, you can try this in your svn root folder:

在(正确配置)zsh中,您可以在svn根文件夹中尝试:

sed -ns "4 p" **/.svn/entries | sort | uniq

It will give the revision of your latest update, or the list of revisions if your repository is mixed. It is not as complete as what is doing "svnversion", and it may not be compliant with all svn versions (mine is 1.6.16) but it does the job in some cases and it is incredibly fast (1s vs 3mn in my case!)

如果您的存储库是混合的,它将提供您的最新更新的修订版或修订列表。它没有做什么“svnversion”那么完整,它可能不符合所有的svn版本(我的是1.6.16),但它在某些情况下完成了工作并且速度非常快(在我的情况下为1s vs 3mn) !)


推荐阅读
author-avatar
prescott1972
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有