[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Checking disk space usage on the server.

From: Andrew Thompson <subversionuser_at_aktzero.com>
Date: 2005-04-04 18:08:38 CEST

Gary Ormsby wrote:
> I'm sorry. I should have been more explicit.
> I'm mainly interested in the disk usage on the server.
> I was thinking about the case where a directory is created by copying
> another directory, by using the svn copy command. It says here that such
> copies are very cheap disk usage-wise:
> http://svnbook.red-bean.com/en/1.0/ch04s02.html#svn-ch-4-sect-2.1. I'd like
> to measure that.
> If I create a new directory from an existing directory with the "svn copy"
> command how much disk space is used to store the newly created directory?
> As files are modified in the new directory I'm assuming the disk usage on
> the server will increase as the links are replaced by actual files (or more
> likely be replaced by the diffs between the original files and the changes).
> I believe check outs by clients always download the complete file.

A clean checkout would always download the entire file.

action: size in bytes (as reported by du repository_path -sb)
Empty database: 11683
Added directory: 12074
Copied empty directory: 12513
Added zero byte text file to directory: 13200
Copied directory: 13996
Added one line of text to original file: 14796
Copied directory with modified file: 15637

The first copy of an empty directory cost 439 bytes.
The copy containing a zero-length file cost 796 bytes.
The copy containing a one-line file cost 841 bytes.

Note that the raw size here is deceiving...

C:\tmp\size\db\revs>ls -al
total 7
drwxrwxrwx 1 user group 0 Apr 4 11:51 .
drwxrwxrwx 1 user group 0 Apr 4 11:51 ..
-rw-rw-rw- 1 user group 115 Apr 4 11:32 0
-rw-rw-rw- 1 user group 270 Apr 4 11:34 1
-rw-rw-rw- 1 user group 324 Apr 4 11:35 2
-rw-rw-rw- 1 user group 562 Apr 4 11:37 3
-rw-rw-rw- 1 user group 662 Apr 4 11:38 4
-rw-rw-rw- 1 user group 672 Apr 4 11:41 5
-rw-rw-rw- 1 user group 700 Apr 4 11:51 6

A final copy, similar to the last copy in the size.txt logfile resulted
in a 870 byte increase in the repository. I am guessing this number
would continue to grow at a small rate if you ran more copies.

Only 729 of the 870 bytes were recorded into the revision 7 file.
Perhaps some logging or other data ate up the rest of it.

Hope this is useful/informative to someone...

Andrew Thompson
Interested in a hosted SVN repository? Email me, let's talk...

C:\>cd tmp

C:\tmp>svnadmin create --fs-type=fsfs size

C:\tmp>du c:/tmp/size -sb
11683 c:/tmp/size

C:\tmp>mkdir s

C:\tmp>cd s

C:\tmp>cd s

C:\tmp\s>svn co file:///c:/tmp/size/ .
Checked out revision 0.

C:\tmp\s>svn mkdir dir1
A dir1

C:\tmp\s>svn ci -m "dir1: added a directory"
Adding dir1

Committed revision 1.

C:\tmp\s>du c:/tmp/size -sb
12074 c:/tmp/size

C:\tmp\s>svn cp dir1 file:///c:/tmp/size/dir2 -m "copied directory"

Committed revision 2.

C:\tmp\s>du c:/tmp/size -sb
12513 c:/tmp/size

C:\tmp\s>touch dir1\asdf.txt

C:\tmp\s>svn add dir1\asdf.txt
A dir1\asdf.txt

C:\tmp\s>svn ci -m "dir1\asdf.txt: added a file"
Adding dir1\asdf.txt
Transmitting file data .
Committed revision 3.

C:\tmp\s>du c:/tmp/size -sb
13200 c:/tmp/size

C:\tmp\s>svn cp dir1 file:///c:/tmp/size/dir3 -m "copied a directory with a file in it"

Committed revision 4.

C:\tmp\s>du c:/tmp/size -sb
13996 c:/tmp/size

C:\tmp\s>svn update
A dir2
A dir3
A dir3\asdf.txt
Updated to revision 4.

C:\tmp\s>echo this is some text for a file > dir3\asdf.txt

C:\tmp\s>cat dir3\asdf.txt
this is some text for a file

C:\tmp\s>svn ci -m "dir3\asdf.txt: added some text"
Sending dir3\asdf.txt
Transmitting file data .
Committed revision 5.

C:\tmp\s>du c:/tmp/size -sb
14796 c:/tmp/size

C:\tmp\s>svn cp dir3 file:///c:/tmp/size/dir4 -m "copied a directory with a file
 in it, again"

Committed revision 6.

C:\tmp\s>du c:/tmp/size -sb
15637 c:/tmp/size

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Apr 4 18:14:38 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.