若要最佳化 GraphQL 篩選器的效能,您需要運行一個程序來更新您的內容片段。
更新內容片段後,您可以依照最佳化 GraphQL 查詢的建議進行。
此任務的必備條件:
確保您至少擁有 2023.1.0 版本的 AEM as a Cloud Service。
確保執行任務的使用者具有必要權限:
Deployment Manager
角色。若要執行該程序,請使用以下步驟:
透過使用 Cloud Manager UI 為您的執行個體設定以下變數來啟用更新:
可用變數為:
名稱 | 值 | 預設值 | 服務 | 已應用 | 類型 | 附註 | |
---|---|---|---|---|---|---|---|
1 | `CF_MIGRATION_ENABLED` | `1` | `0` | 全部 | 變數 | 啟用(!=0) 或停用 (0) 觸發內容片段遷移作業。 | |
2 | `CF_MIGRATION_ENFORCE` | `1` | `0` | 全部 | 變數 | 執行 (!=0) 內容片段的重新遷移。 此標幟設定為 0 將可執行 CF 的增量遷移。這表示,如果作業由於任何原因終止,則下一次執行作業將從作業被終止的那個點開始遷移。請注意,建議強制執行第一次遷移 (值=1)。 |
|
3 | `CF_MIGRATION_BATCH` | `50` | `50` | 全部 | 變數 | 遷移後用來儲存內容片段數量的批次大小。 這與多少個 CF 將在一批中儲存到存放庫有關,並且可以用來最佳化寫入存放庫的數量。 |
|
4 | `CF_MIGRATION_LIMIT` | `1000` | `1000` | 全部 | 變數 | 一次處理的最大數量的內容片段。 另請參閱 “CF_MIGRATION_INTERVAL” 的註釋。 |
|
5 | `CF_MIGRATION_INTERVAL` | `60` | `600` | 全部 | 變數 | 處理剩餘內容片段直到下一個限制的時間間隔 (秒) 此時間間隔也被視為開始作業之前的等待時間,以及處理每個後續 CF_MIGRATION_LIMIT 數量的 CF 之間的延遲。 (*) |
(*)
CF_MIGRATION_INTERVAL
值還可以幫助估計遷移作業的總執行時間。
例如:
您還應注意,這只是完成作業所需的最短時間,不包括 I/O 時間。實際花費的時間可能遠遠超過這個估計。
監控更新的進度和完成情況。
為此,請從以下位置監控作者和 golden-publish 的記錄:
com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob
作者記錄;例如:
23.01.2023 13:13:45.926 *INFO* [sling-threadpool-09cbdb47-4d99-4c4c-b6d5-781b635ee21b-(apache-sling-job-thread-pool)-1-Content Fragment Upgrade Job Queue Config(cfm/upgrader)] com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob This instance<dd9ffdc1-0c28-4d04-9a96-5d4d223e457e> is the leader, will schedule the upgrade schedule job.
...
23.01.2023 13:13:45.941 *INFO* [sling-threadpool-09cbdb47-4d99-4c4c-b6d5-781b635ee21b-(apache-sling-job-thread-pool)-1-Content Fragment Upgrade Job Queue Config(cfm/upgrader)] com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob Scheduling content fragments upgrade from version 0 to 1, slingJobId: 2023/1/23/13/13/50e1a575-4cd7-497b-adf0-62cb5768eedb_0, enforce: true, limit: 1000, batch: 50, interval: 60s
23.01.2023 13:20:40.960 *INFO* [sling-threadpool-09cbdb47-4d99-4c4c-b6d5-781b635ee21b-(apache-sling-job-thread-pool)-1-Content Fragment Upgrade Job Queue Config(cfm/upgrader)] com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob Finished content fragments upgrade in 6m, slingJobId: 2023/1/23/13/13/50e1a575-4cd7-497b-adf0-62cb5768eedb_0, status: MaintenanceJobStatus{jobState=SUCCEEDED, statusMessage='Upgrade to version '1' succeeded.', errors=[], successCount=3781, failedCount=0, skippedCount=0}
Golden-publish 記錄;例如:
23.01.2023 12:35:05.150 *INFO* [sling-threadpool-8abcc1bb-cdcb-46d4-8565-942ad8a73209-(apache-sling-job-thread-pool)-1-Content Fragment Upgrade Job Queue Config(cfm/upgrader)] com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob This instance<ad1b399e-77be-408e-bc3f-57097498fddb> is the leader, will schedule the upgrade schedule job.
23.01.2023 12:35:05.161 *INFO* [sling-threadpool-8abcc1bb-cdcb-46d4-8565-942ad8a73209-(apache-sling-job-thread-pool)-1-Content Fragment Upgrade Job Queue Config(cfm/upgrader)] com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob Scheduling content fragments upgrade from version 0 to 1, slingJobId: 2023/1/23/12/34/ad1b399e-77be-408e-bc3f-57097498fddb_0, enforce: true, limit: 1000, batch: 50, interval: 60s
...
23.01.2023 12:40:45.180 *INFO* [sling-threadpool-8abcc1bb-cdcb-46d4-8565-942ad8a73209-(apache-sling-job-thread-pool)-1-Content Fragment Upgrade Job Queue Config(cfm/upgrader)] com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob Finished content fragments upgrade in 5m, slingJobId: 2023/1/23/12/34/ad1b399e-77be-408e-bc3f-57097498fddb_0, status: MaintenanceJobStatus{jobState=SUCCEEDED, statusMessage='Upgrade to version '1' succeeded.', errors=[], successCount=3781, failedCount=0, skippedCount=0}
使用 Splunk 啟用環境記錄存取權的客戶可以使用下面的範例查詢來監控升級程序。有關啟用 Splunk 記錄的詳細資訊,請參閱偵錯生產和中繼頁面。
index=<indexName> sourcetype=aemerror aem_envId=<environmentId> msg="*com.adobe.cq.dam.cfm.impl.upgrade.UpgradeJob Finished*"
(aem_tier=golden-publish OR aem_tier=author) | table _time aem_tier pod_name msg | sort -_time desc
其中:
environmentId
- 客戶環境識別碼;例如,e1234
indexName
- 客戶索引名稱,收集 aemerror
事件輸出範例: