修改 Java 記憶體設定

Edge for Private Cloud 4.17.01 版

視流量和處理需求而定,您可能需要增加一或多個 Apigee 元件的堆積大小或類別中繼資料大小。

如要變更這些設定,請編輯元件的屬性檔案。如果元件安裝在多部機器上 (例如 Edge 訊息處理器),請在託管元件的所有機器上編輯屬性檔案。

如要設定這些值,請設定下列屬性:

  • bin_setenv_min_mem:設定堆積大小下限。預設值為 256 MB。
  • bin_setenv_max_mem:設定堆積大小上限。預設值為 512 MB。
  • bin_setenv_meta_space_size:設定類別中繼資料的大小上限。預設值會設為 bin_setenv_max_permsize 的值,預設為 128 MB。在訊息處理器上,Apigee 建議您將這個值設為 256 MB 或 512 MB,具體取決於流量。

請為機器上的每個元件設定這些屬性,並使用「m」後置字串表示 MB。 舉例來說,如果是訊息處理器,請在 /opt/apigee/customer/application/message-processor.properties 檔案中設定:

bin_setenv_min_mem=512m
bin_setenv_max_mem=1024m
bin_setenv_meta_space_size=1024m

如果 message-processor.properties 檔案不存在,或任何 Edge 元件的對應 .properties 檔案不存在,請建立該檔案,然後將檔案擁有權變更為「apigee」使用者:

> chown apigee:apigee /opt/apigee/customer/application/message-processor.properties

在 .properties 檔案中設定值後,請重新啟動元件:

> /opt/apigee/apigee-service/bin/apigee-service component restart

例如:

> /opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart

如需更多設定記憶體的提示,請參閱 Edge 論壇上的這篇文章。