[Other doc versions]
[Doc downloads]
If you've got CI or other automatic tooling set up to poll Stash for changes, you can end up with high load on your Stash server. Consider for instance a CI server that has a number of builds set up for a given repository. Each of those builds polls Stash for changes and when it detects a change, it starts a new build. If your CI server supports parallel and/or chained build steps, each of these builds typically results in multiple clone operations of the same repository. The result: lots of polling for changes, and bursts of clones of a repository.
CI results in highly repetitive calls to Stash: polling for changes typically results in the same response 90% of the time and a build triggers a number of identical clone calls to Stash. Both operations can benefit greatly from caching when you experience repetitive load from CI.
Stash 2.5, and later versions, ship with the SCM Cache Plugin already bundled. The plugin is enabled by default, but note that ref advertisement is disabled by default – see the 'Limitations' section below. The plugin is also available from the Atlassian Marketplace.
On this page:
ref advertisements 操作の場合もクローン操作の場合も、キャッシュ データはディスクに保存されます。保存期間は設定できます。大きなインスタンスはディスク全体を潜在的に消費する可能性があるため、SCM Cache Plugin は残りのディスク容量を監視し、設定された最低ディスク空き容量に達すると自動的に無効化されます。
See Stash config properties for descriptions of the available system properties.
Enable the SCM Cache Plugin from the admin area in Stash. Click Manage Add-ons (under 'Add-Ons') and filter for system add-ons. Click SCM Cache Plugin for Stash and then either Enable or Disable.
The SCM Cache Plugin for Stash can be configured using either the REST endpoint (some settings, not all) or the system properties in <STASH-HOME>/stash-config.properties
. Settings configured through REST are considered before the settings in stash-config.properties
.
メソッド | URL | 説明 |
---|---|---|
GET | /rest/scm-cache/latest/config/protocols | キャッシュが有効化されているプロトコルを取得します。 |
PUT | /rest/scm-cache/latest/config/protocols/{protocol} | プロトコル (HTTP または SSH) のホスティング リクエストのキャッシングを有効化します。 |
削除 | /rest/scm-cache/latest/config/protocols/{protocol} | プロトコル (HTTP または SSH) のホスティング リクエストのキャッシングを無効化します。 |
GET | /rest/scm-cache/latest/config/refs/enabled | ref advertisement キャッシュが有効化されているか (true) 無効化されているか (false) を取得します。 |
PUT | /rest/scm-cache/latest/config/refs/enabled/{status} | ref advertisement キャッシュを有効化 (status = true) または無効化 (status = false) します。 |
GET | /rest/scm-cache/latest/config/refs/ttl | ref advertisement キャッシュの有効期限を秒単位で取得します。 |
PUT | /rest/scm-cache/latest/config/refs/ttl/{expiryInSec} | ref advertisement キャッシュの有効期限を秒単位で設定します。 |
GET | /rest/scm-cache/latest/config/upload-pack/enabled | クローン キャッシュが有効化されているか (true) 無効化されているか (false) を取得します。 |
PUT | /rest/scm-cache/latest/config/upload-pack/enabled/{status} | クローン キャッシュを有効化 (status = true) または無効化 (status = false) します。 |
GET | /rest/scm-cache/latest/config/upload-pack/ttl | クローン キャッシュの有効期限を秒単位で取得します。 |
PUT | /rest/scm-cache/latest/config/upload-pack/ttl/{expiryInSec} | クローン キャッシュの有効期限を秒単位で設定します。 |
GET | /rest/scm-cache/latest/caches | 現在のキャッシュに関する情報 (サイズ、キャッシュのヒット数、ミス数など) を取得します。 |
削除 | /rest/scm-cache/latest/caches | すべてのキャッシュをクリアします。 |
GET | /rest/scm-cache/latest/caches/{projectKey}/{repoSlug} | projectKey および repoSlug で識別されるリポジトリのキャッシュに関する情報 (サイズ、キャッシュのヒット数、ミス数など) を取得します。 |
削除 | /rest/scm-cache/latest/caches/{projectKey}/{repoSlug} | projectKey および repoSlug で識別されるリポジトリのキャッシュをクリアします。 |