Performance of TeamCity REST API affected by credentials used?

I recently changed the credentials that my ASP.Net MVC application uses to invoke my TeamCity server via the REST API and I soon noticed a significant performance degradation, i.e. some pages that used to take a couple of seconds to load now take over a minute.

After investigating with further with a performance profiler I can see the bottleneck being the calls to TeamCity. Initially I thought the problem was with the TeamCity Server, but after changing the credentials back to the previous user name and password the performance is back to what it was.

After further investigation outside my application using the ARC tool I can see that making the same API call takes around 400ms with the old credentials and in excess of 7,000ms with the new credentials.

The only thing I can think that perhaps could affect this is the roles and groups of the two TeamCity users belong to, however I have made sure they are identical and I the performance differential is still the same.

I don't see any error related to these calls in the teamcity.rest log.

Does anyone have any advice for what else might be affecting this or how I can try to diagnose this further?

8 comments

Hello Alex,

Thank you for the detailed report. Could you please attach an example of the slow request, teamcity-rest.log and several server thread dumps taken during processing of this REST API call?

0

What authentication modules do you have enabled? Could you please try to login via TeamCity UI using different credentials? What is the result?

Currently REST API call performs authorization on each request, please try the following workaround.

0

Hi Alina,

 

Thanks for getting back to me.

I have tried your suggestion of using th TCSESSION id from the first response and that does help improve the performance for repeated calls quite significantly, thanks. 

The original issue of two different accounts having significant difference in performance however is still there when making the first call. When making subsequent calls and using the TCSESSION cookie the timings for both accounts are the same.

I did login to the TC UI using both accounts but I can't notice any difference.

The api call I am using for testing this is http://teamcity/app/rest/builds/?locator=buildType:(id:MyBuildConfigId),count:1, however I have seen this issue with a number of different calls.

It does not look as I can attach log files to this post, so here's a screenshot if it helps:

See also the timeline of the request from the ARC tool:

Using the "slow" account

Using the "quick" account:

 

 

0

Thank you for details. What authentication modules do you have enabled? Are these two users maintained by TeamCity?

0

The credential authentication modules are Microsoft Windows domain and Built-in, both users are setup using the built-in credentials.

The HTTP authentication modules are Basic HTTP and NTLM HTTP.

0

Hi Alex,

Sorry for delay in replying. It's rather strange that login via UI is fats and via REST API is slow using the same username/password.

Could you please enable debug-auth logging preset on Administarion > Dignostics page, reproduce the issue (login via UI and REST API with the same user) and attach the resulted teamcity-auth.log file.

Thank you!

0

Hi, is there any further update on this issue as i'm experiencing something similar 

0

Hello Simon,

Is login via UI fast and via REST API slow using the same username/password for you? If yes, then please enable debug-auth logging preset on Administarion > Dignostics page, reproduce the issue (login via UI and REST API with the same user) and attach the resulted teamcity-auth.log file.

0

Please sign in to leave a comment.