views:

414

answers:

3

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.

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.

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?

+1  A: 

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?

John Weldon
Might a large file-count commit into the repository in a directory not beneath our checkout path affect us in this fashion? We typically work in repo-root/proj1/... and recently (in fact, coincidentally with my observation of slow response) one of our devs commit a HUGE list of files to repo-root/proj2/..
antik
Running svnversion -n on a local working copy doesn't result in traffic to the subversion server. I believe it uses the property information stored in the .svn/_svn folders which contains things like current revision, last commit revision, and whether it is modified or not in order to determine the result. If the large commit was not done within the scope of the working copy, would this impact running `svnversion -n` locally and if so, why?
Burly
A: 

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:

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.

Peter Parker
Am I wrong in my assumption that a repo running on svn+ssh would not be affected by this issue? If not, then this answer isn't relevant to my configuration: we do not use https.
antik
You didn't mentioned the protocol you were using..
Peter Parker
You're right - thanks for an answer that hilighted that shortcoming in the question.
antik
A: 

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.

Joshua Kugler