shell – 夏清然的日志 https://www.qingran.net Xia Qingran Geek Blog Sun, 07 Aug 2016 09:50:33 +0000 en-US hourly 1 https://wordpress.org/?v=4.6.1 112893047 获得MySQL/PostgreSQL的内存占用比例的脚本 https://www.qingran.net/2010/05/%e8%8e%b7%e5%be%97mysqlpostgresql%e7%9a%84%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8%e6%af%94%e4%be%8b%e7%9a%84%e8%84%9a%e6%9c%ac/ https://www.qingran.net/2010/05/%e8%8e%b7%e5%be%97mysqlpostgresql%e7%9a%84%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8%e6%af%94%e4%be%8b%e7%9a%84%e8%84%9a%e6%9c%ac/#comments Mon, 24 May 2010 07:32:31 +0000 https://www.qingran.net/?p=364 获得MySQL/PostgreSQL在GNU/Linux和FreeBSD下的内存占用比例:

GNU/Linux系统

MySQL

ps -o pmem,comm ax  | grep mysql | awk '{SUM+=$1}END{print SUM}'

PostgreSQL

ps -o pmem,comm ax  | grep postgre | awk '{SUM+=$1}END{print SUM}'

FreeBSD系统

MySQL

ps -o pmem,comm -wuax | grep mysql | awk '{SUM+=$1}END{print SUM}'

PostgreSQL

ps -o pmem,comm -wuax | grep postgre | awk '{SUM+=$1}END{print SUM}'

其他进程也可以如法泡制~

]]>
https://www.qingran.net/2010/05/%e8%8e%b7%e5%be%97mysqlpostgresql%e7%9a%84%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8%e6%af%94%e4%be%8b%e7%9a%84%e8%84%9a%e6%9c%ac/feed/ 1 364