August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

shell to get the process usage in MB

#!/bin/bash ps -A -o pid,rss,command | grep nginx | grep -v grep | awk ‘{total+=$2}END{printf(“nginx=%dMb\n”, total/1024)}’ ps -A -o pid,rss,command | grep php-fpm | grep -v grep | awk ‘{total+=$2}END{printf(“php-fpm=%dMb\n”, total/1024)}’ ps -A -o pid,rss,command | grep mysqld | grep -v grep | awk ‘{total+=$2}END{printf(“mysql=%dMb\n”, total/1024)}’ ps -A -o pid,rss,command | grep transmission-da | grep […]

TOP 12 ‘PS’ PERFORMANCE COMMANDS

TOP 12 ‘PS’ PERFORMANCE COMMANDS

admin@UM 02:03 AIX, Unix I use following ps commands in order to check for performance probelms: 1) Displaying top CPU_consuming processes:

# ps aux|head -1; ps aux|sort -rn +2|head -10 2) Displaying top 10 memory-consuming processes:

# ps aux|head -1; ps aux|sort -rn +3|head 3) Displaying process in order […]

LINUX MEMORY

Find Memory Usage

System memory used and free

Total Used and Free Memory in MBytes (in that order)

free -m|grep “buffers/cache”|cut -d”:” -f2 Memory by Process

Raw

ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS Human readable

ps -e -orss=,args= | sort -b -k1,1n | awk ‘{ split( “KB MB GB” , v […]

JMAP, HISTO, Thread Dump, CPU Utilization

Dear Reader,

In a production environment Java Profiling is not an option, we have seen multiple times that our CPU has reached almost 100% or even 300% sometime. That is really a panic scenario especially when you are handling production environment or at client place to check what went wrong.

Fortunately, Java comes with some […]