When assessing if we can could use GCP Artifact Registry (virtual repositories) for maven central we stumbled upon an issue with very high latencies that make production usage of artifact registry impossible (as build times double). It seems like we are not alone, as many have reported this issue:
Hello @davidkarlsson,
I think that you may be interested in looking at Artifact Registry Repository Overview. As per my understanding, you need a Remote Repository instead of a Virtual Repository because its limitations that may give poor performance.
Apt and Yum standard repositories update the package index asynchronously after a package is imported, uploaded, or deleted. For small repositories, regenerating the index can take several seconds. For larger repositories, reindexing might take several minutes or longer. After reindexing is complete, the change to the repository is visible to Apt and Yum clients.
You may also read the Download Packages part and give a look at the priority order.
For example, consider a virtual repository with the following priority settings for upstream repositories:
main-repo: Priority set to100
secondary-repo1: Priority set to80.
secondary-repo2: Priority set to80.
test-repo: Priority set to20.
main-repohas the highest priority value, so the virtual repository always searches it first.
Note quite following, there is as far as I can see no limitations specified about Maven specifically in the docs (only Yum & Apt).
Also, we have tried both using remote repository directly, and a virtual repository pointing to the remote, but results are the same.
Mmh, looks like I was indeed off track. ![]()
Remote and virtual repositories are supposed to improve latency, not worsen it.
Since the issue was reported by a Googler, it’s likely something that can only be properly fixed on GCP’s side.