|Automatic maintenance of application server side repository [message #1240030]
||Wed, 05 February 2014 15:14
| Laurent Petit
Registered: December 2010
My web application uses a jgit repository to store content.
It can have a very high uptime (not being restarted for weeks or months).
When the client git is used on the command line, there are some "cleanup" operations that are done from time to time.
Out of the top of my head:
- garbage collection
What would be the best way to trigger these operations when a repository will be managed programatically by a very long running process ?
- I have found a gc() method, what about packing ?
- During the associated maintenance calls, what can be still performed in parallel on the git repository ( it's a web application, concurrent requests can occur ) ? I already serialize access to the "write" operations, should I consider these maintenance operations as "write operations" as well ? Do they generally last long ? Is there a scheduling policy that would minimize the time spent each time ?
Thanks in advance,
|Re: Automatic maintenance of application server side repository [message #1240080 is a reply to message #1240030]
||Wed, 05 February 2014 16:55
| Matthias Sohn
Registered: July 2009
- gc includes repacking and might take a long time and consume considerable resources (heap and CPU) |
depending on the size and complexity of the repository
- you shouldn't run multiple gc commands concurrently on the same repository since this would waste a lot of
resources, if you try that anyway some of the concurrent runs may fail if they fail to acquire locks implemented
by LockFile  which is using atomic rename of the lock file to implement locking semantics in jgit. Native git
is using the same locking mechanism.
- there are only a few commands which modify existing objects in these cases jgit (and native git) use this
locking mechanism relying on the atomicity of renaming a file, on filesystems not providing atomic rename git's
locking mechanism won't work
- running other modifying operations like push, update ref etc should be safe to run while gc is running
- which kind of write operations is your application using ?
- why are you serializing write operations ? This severely limits scalability for these operations.
Powered by FUDForum
. Page generated in 0.05336 seconds