![IIS 主機上限制 ApplicationPool 記憶體的方法](https://rain.tips/wp-content/uploads/2023/09/image.png)
IIS 主機上限制 ApplicationPool 記憶體的方法
最近遇到 PHP 太吃記憶體的問題,我除了在php.ini 中設定 limit memory 以外,也打算在 IIS 中把總量的記憶體限制住,避免讓主機的記憶體爆滿,而當機,可以在記憶題超過限制後,把自己行程回收。
![](https://rain.tips/wp-content/uploads/2023/09/image.png)
設定方法
在管理介面中,找到 「Advanced Settings」 ,進去後往下滑找到 「Private Memory Limit (KB)」 ,這邊這個數值是 KB 為主,如果希望將 Private Memory Limit (KB)
設定為 10GB,您需要將其設定為 10485760
KB 設定公式如下
10 GB = 10 * 1024 * 1024 KB = 10485760 KB
我設定的邏輯是觀察主機上所有的 Application Pool 會用到多少的記憶體,然後去分配她
近期留言