Skip to content

Instantly share code, notes, and snippets.

@rpfilomeno
Created March 12, 2015 15:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpfilomeno/fadf0a04c5cac970ba38 to your computer and use it in GitHub Desktop.
Save rpfilomeno/fadf0a04c5cac970ba38 to your computer and use it in GitHub Desktop.
Linux Performance Testing
# less /proc/cpuinfo | grep "physical id" | sort|uniq | wc -l
2
# less /proc/cpuinfo | grep "core id" | sort|uniq | wc -l
1
Optimal load average (100% utilization) = 2.0
(The "Red line" load average = 5.0 per processor)
Profiling a command/script/application:
# perf stat <command>
Profiling a process:
# ps ax | fgrep <process-name>
# perf stat -p <process-id>
(press Ctrl+C to stop and display result)
# perf stat -p <process-id> sleep <x-seconds>
(profiles for X seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment