Git push operations extremely slow on Windows
Push operations in Windows environments take above 20 seconds (minutes) to be completed:
[33391ms] - "POST /scm/TEST/foo.git/git-receive-pack HTTP/1.1" [203ms] - Bitbucket ServerUser com.atlassian.bitbucket.user.UserService.authenticate(String,String,CaptchaResponse) [0ms] - InternalBitbucket ServerUser com.atlassian.bitbucket.internal.user.Bitbucket ServerUserDao.findByName(String) [0ms] - void com.atlassian.bitbucket.internal.user.RepositoryAccessDao.trimToFirstPage(InternalBitbucket ServerUser,int,Predicate) [0ms] - boolean com.atlassian.bitbucket.user.PermissionService.hasRepositoryPermission(Bitbucket ServerUser,Repository,Permission) [0ms] - boolean com.atlassian.bitbucket.internal.user.GrantedPermissionDao.isGrantedToUser(UserPermissionSearchCriteria) [0ms] - boolean com.atlassian.bitbucket.user.PermissionService.hasRepositoryPermission(Bitbucket ServerUser,Repository,Permission) ...
Running Bitbucket Server as a user (either via Windows service or not) that is part of the Administrator group causes Windows to spend a lot of time running permission checks.
If you installed Bitbucket Server as a service using the installer as described on Getting started, you shouldn't be seeing this issue when it is run as a service. A user
atlbitbucket is created and responsible for running Bitbucket Server. This user is not a member of the Administrator group. Please refer to Run the Bitbucket installer for more details on the
Resolution option 1 (recommended) - Reinstall Bitbucket Server as a local user
In order to change the Bitbucket Server user, the following procedure is the preferred option:
- Stop the current Bitbucket Server instance
- Install a new Bitbucket Server on the windows server by using the installer
- Select a new installation directory
- Select the existing home directory
- Bitbucket Server is now up and running with the expected Windows user details
Resolution option 2 - Microsoft hotfix
If Bitbucket Server cannot be run as a non-administrator user, apply this hotfix http://support.microsoft.com/kb/2545833.