Performance Engineering FAQ

As per few requests. I am posting FAQ of PSR (Performance,Scalablity, Reliability). I dont want to focus on basic questions like what is psr? why psr? . here the focus is on technical questihons .

1) while monitoring memory for a 64bit process do u track RSS or VM ? . what do u think if RSS is less but VM is more on Linux-x64.

Ans)The VmLib or VmExe memory could be more. do  $ cat /proc/pid/status and see which section of memory is taking more memory.

2) how do you take memory break-up of Linux process .

Ans)cat /proc/pid/status. VmData gives you heap section, VmLib gives you shared libs section, VmExe gives Exe size in memory.

3) when you observe a process hang , how do you debug the issue.

Ans)take a thread dump using pstack on linux . do a  $ pstack > output.txt . the output.txt has the threaddump. see on which lock ,all the threads are waiting. if it is deadlock then debug the lock issues and optimize the lock/algorithms and rfe-run your application. 

4) when the process cpu is high for your app, how do you find the bottlenecks in your app.

Ans) This could be  due to cpu bottleneck because of your algorithms . run valgrind --tool=callgrind tool for cpu graph profiling and identify method which is taking more cpu. solve the method/functions which are taking more cpu.

5) how do u find how number of threads given process id.

Ans) cat /proc/pid/status | grep Threads. this will give number of threads taken by your app.

6) if the kernel cpu is very high for an application, what does it indicate.

Ans)your Application could be using more system calls. launch strace to find out system calls used by your app.
strace -c -o output.txt ./application . this logs all systemcalls  and time spent in system calls in output.txt by your ./application binary.

7)what is  diff b/w 32bit and 64bit cpu architecture. does 64bit process is faster than 32bit  ?

Ans) using 64bit machine , the advantage comes out when you need to access memory more than 4GB. 64 bit architectures include LP64,LLP64,ILP64 . where L is long,I is integer , P is for pointer. most platforms use LP64 which has long, pointer occupy 8 bytes. 32bit process cant go beyond 4 GB memory because memory addressing is just 32bit. many times 64bit process is faster than 32bit when it comes to memory operations.


No comments: