Changes between Version 34 and Version 35 of jazz/Performance_Tuning
- Timestamp:
- Apr 11, 2011, 10:28:01 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
jazz/Performance_Tuning
v34 v35 80 80 sysctl -w vm.vfs_cache_pressure=n (n > 100) 81 81 }}} 82 * 如何清除使用中的 SWAP 呢?(把 SWAP 的內容釋放出來) 82 * 如何清除使用中的 SWAP 呢?(把 SWAP 的內容釋放出來) - <參考> [http://superuser.com/questions/115565/how-do-i-free-virtual-memory-in-ubuntu How do I free virtual memory in Ubuntu?> 83 83 {{{ 84 84 sudo swapoff -a 85 85 sudo swapon -a 86 86 }}} 87 * 關於 /proc/sys/vm/swappiness 或 vm.swappiness 87 * 關於 /proc/sys/vm/swappiness 或 vm.swappiness ([wiki:jazz/11-02-27 2011-02-27]) 88 88 * 數值範圍:0 ~ 100,通常預設值為 60 89 89 * 0 : 除非有必要才把虛擬記憶體搬到 SWAP 90 90 * 1 : 非常頻繁地將虛擬記憶體(VIRT)搬到 SWAP 91 91 * 100 : 相對比較不頻繁地將虛擬記憶體(VIRT)搬到 SWAP 92 * <參考> [http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page Understanding swap files in Linux] 92 93 93 94 * 如何加速桌面應用 - <參考> [http://rudd-o.com/en/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that Tales from responsivenessland: why Linux feels slow, and how to fix that] … … 96 97 sysctl -w vm.swappiness=1 97 98 sysctl -w vm.vfs_cache_pressure=50 99 }}} 100 101 * ([wiki:jazz/11-02-27 2011-02-27]) 102 * 從「[http://stackoverflow.com/questions/561245/virtual-memory-usage-from-java-under-linux-too-much-memory-used Virtual Memory Usage from Java under Linux, too much memory used]」這篇討論,學到一個指令:pmap,隸屬於 [http://packages.debian.org/procps procps 套件]中。用法是 pmap -x $PID (不同身份時,得透過 sudo 取得記憶體狀態) 103 {{{ 104 procps: /usr/bin/pmap 105 }}} 106 {{{ 107 ~$ sudo pmap -x $PID 108 }}} 109 {{{ 110 jazz@drbl:~$ sudo pmap 24972 111 24972: /usr/bin/php5-cgi 112 0000000000400000 5144K r-x-- /usr/bin/php5-cgi 113 0000000000b06000 356K rw--- /usr/bin/php5-cgi 114 0000000000b5f000 32K rw--- [ anon ] 115 00000000010da000 2212K rw--- [ anon ] 116 00007f418a02b000 40K r-x-- /lib/libnss_files-2.7.so 117 00007f418a035000 2048K ----- /lib/libnss_files-2.7.so 118 00007f418a235000 8K rw--- /lib/libnss_files-2.7.so 119 00007f418a237000 28K r-x-- /usr/lib/php5/20060613/pdo_mysql.so 120 00007f418a23e000 2044K ----- /usr/lib/php5/20060613/pdo_mysql.so 121 00007f418a43d000 4K rw--- /usr/lib/php5/20060613/pdo_mysql.so 122 ... 略 ... 98 123 }}} 99 124