Get ulimit of a running process in AIX

In RHEL or any recent Linux kernel, getting a running process limit is just a matter of checking /proc/<pid>/limits.

In AIX, it is a bit more complicated.

 

1) Get the process ID

# ps -ef | grep java
jboss 53215284 17301698 0 22:02:42 – 1:29 /usr/java71_64/bin/java -D[Standalone] -server -XX:+UseCompressedOops …

 

2) Convert PID to HEX

# i=53215284; perl -e “printf (‘%x’, $i)”
32c0034

 

3) Grep the PID to get the slot id of threads

# pstat -A | grep -i 32c0034 | more
627 s 273007b 32c0034 unbound other 52 0 10027340 java
720 s 2d00023 32c0034 unbound other 52 0 1002d040 java

 

4) Use the slot id and pass to kdb to get the process limit

# echo “user 627” | kdb | grep rlimit | grep -v “_”
rlimit[CPU]……….. cur 7FFFFFFF max 7FFFFFFF
rlimit[FSIZE]……… cur 7FFFFFFF max 7FFFFFFF
rlimit[DATA]………. cur 7FFFFFFF max 7FFFFFFF
rlimit[STACK]……… cur 02000000 max 7FFFFFFF
rlimit[CORE]………. cur 3FFFFE00 max 7FFFFFFF
rlimit[RSS]……….. cur 7FFFFFFF max 7FFFFFFF
rlimit[AS]………… cur 7FFFFFFF max 7FFFFFFF
rlimit[NOFILE]…….. cur 000007D0 max 7FFFFFFF
rlimit[THREADS]……. cur 7FFFFFFF max 7FFFFFFF
rlimit[NPROC]……… cur 7FFFFFFF max 7FFFFFFF

 

Advertisements