Caching api/v2/repositories - Slow first response

We just migrated all our 164 SVN repos to SCM-manager 3.2.2 running on Ubuntu 22.04.

When navigating to /repos/ the first request to api/v2/repositories is very slow.
It takes ~10 seconds from request to response


Next time the response is instant (sub 1 sec).

Is there any settings to improve caching ?

Hey @lgjli

thank you for your post. Could you please share your hardware setup?
Also do you experience this everytime on the first login? Which plugins do you use? Usually plugins do slow down the first loadup.

SCM-manager is running in a Ubuntu 22.04 VM on a Hyper-v host.
I have allocated 8GB ram and a single virtual CPU on a Xeon E5-1650.
It does not look like the VM is CPU bound.

What hardware specs do you usually recommend ?

I experience this at every login.

I have the following plugins installed:

  "scm-openapi-plugin",
  "scm-mustache-documentation-plugin",
  "scm-audit-log-plugin",
  "scm-custom-storage-plugin",
  "scm-activity-plugin",
  "scm-repository-avatar-plugin",
  "scm-repository-trash-bin-plugin",
  "scm-ssh-plugin",
  "scm-groupmanager-plugin",
  "scm-editor-plugin",
  "scm-commit-message-checker-plugin",
  "scm-commit-search-plugin",
  "scm-binary-search-plugin",
  "scm-svn-plugin",
  "scm-metrics-json-plugin",
  "scm-hg-plugin",
  "scm-tagprotection-plugin",
  "scm-directfilelink-plugin",
  "scm-manage-folder-plugin",
  "scm-repository-size-plugin",
  "scm-content-search-plugin",
  "scm-pushlog-plugin",
  "scm-mail-plugin",
  "scm-pushevent-plugin",
  "scm-code-editor-plugin",
  "scm-git-plugin",
  "scm-ldap-plugin",
  "scm-external-file-plugin",
  "scm-readme-plugin",
  "scm-repository-template-plugin",
  "scm-pathwp-plugin",
  "scm-archive-plugin",
  "scm-review-plugin",
  "scm-legacy-plugin",
  "scm-branchwp-plugin"

Hi @lgjli

thank you for your patience. We will start working on an improvement very soon.
Please stay tuned.

1 Like

Hello @lgjli

we are currently working on this issue and try to figure out, why the responses are slow the first time around. We were wondering, since the repository avatar plugin is installed, how often you are using uploaded images as the repository avatar?

Only in one or two repos.

Could disk I/O be a bottleneck ?
I am storing the repos on a NAS with a 2.5G connection.

Hello @lgjli,

since you are only using it once or twice, the avatar plugin should not cause any issues.

The I/O of your NAS could be the reason for this issue. You could try to uninstall the readme plugin and the repository template plugin one by one and check if the response time gets improved. This could help us identify the bottleneck. By uninstalling the plugins you don’t have to fear the loss of data.

If uninstalling the plugins does not help, could you provide us with a profile of the java process? We would explain you to how to do this.

I will try and disable the plugins and check.

Of course I can provide you with a profile. Please let me know how to do it.

Did uninstalling those plugins help with performance?

Regarding the profile, how do you run the scm manager? Are you running it as a docker container or debian / ubuntu package?

I will try disabling the plugins as soon as possible and return.

We are running using the .deb package on Ubuntu 22.04

To enable the profiling with the Java Flight Recorder, you need to pass extra arguments to the JVM. You can do this, by appending the file /etc/default/scm-server with this line.

EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -XX:StartFlightRecording=name=scm,filename=<path/where/record/should/be/created.jfr>,dumponexit=true"

Don’t forget to adjust the path to the report file.
After that you need to stop the scm-manager service and start it again. Open the page until the repositories are loaded. After that stop the service again. Then the report file should be created at the path you specified. Don’t worry if the scm-manager is very slow while the recording is active, that is normal. After you are finished, just remove the added line, restart the service and send us the report file. Thank you for your help :]

I tried disabling readme and template plugins and got the following result:
Both uninstalled: 500 ms response
Only Readme installed : 8000 ms
Only template installed : 5000 ms
Both installed: 8000 ms

It seems like both plugins are to blame.

I also made a flight recorder log

Thank you for your patience!

Hello @lgjli,

could you please provide us with the flight recorder log.

of course, I will send it in a personal message now.