You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

oprofile

This is a sampling profiler, so it has minimal impact on Traffic Servers performance.

Running the profiler and checking the status. Make sure the call depth is set to where you want it.

// start the deamon
bcall@snowball trafficserver$ sudo opcontrol --start-daemon
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
Detected stale lock file. Removing.
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.

// check the status
bcall@snowball trafficserver$ sudo opcontrol --status
Daemon running: pid 29524
Separate options: library
vmlinux file: none
Image filter: none
Call-graph depth: 6

After making sure the daemon is running aand your settings are set to what you want. Start traffic server and start running the benchmark. I normally wait a few seconds for things to warm up before I start to profile the code.

// profile the code for 60 seconds
bcall@snowball trafficserver$ sudo opcontrol -s; sleep 60; sudo opcontrol -t
Profiler running.
Stopping profiling.

Running a basic report will tell you what functions are showing up in the sampled profile the most.

bcall@snowball trafficserver$ opreport --symbols /usr/local/bin/traffic_server | head
CPU: Core 2, speed 2003 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples % image name app name symbol name
36603 8.1552 traffic_server traffic_server EThread::EThread()
13724 3.0577 traffic_server traffic_server LogBuffer::checkout_write(unsigned long*, unsigned long)
11137 2.4813 libpthread-2.11.1.so traffic_server pthread_mutex_trylock
10897 2.4279 traffic_server traffic_server HttpConfig::startup()
10702 2.3844 traffic_server traffic_server RecGetRecordPrefix_Xmalloc(char*, char*, int)
8869 1.9760 traffic_server traffic_server LogCollationClientSM::client_send(int, VIO*)
7952 1.7717 libc-2.11.1.so traffic_server memcpy

Running a callgraph report.

bcall@snowball trafficserver$ opreport -c -g --symbols proxy/traffic_server
samples % linenr info image name app name symbol name
-------------------------------------------------------------------------------
10 1.3661 UnixConnection.cc:162 traffic_server traffic_server Connection::bind_connect(unsigned int, int, unsigned int, NetVCOptions*, int, bool, bool, bool, bool, bool)
68 9.2896 Update.cc:1138 traffic_server traffic_server UpdateScheduler::ScheduleEvent(int, void*)
71 9.6995 Hash_Table.cc:223 traffic_server traffic_server HashTable::remove(int, char*, _alt_hdr*)
223 30.4645 UnixNetAccept.cc:166 traffic_server traffic_server NetAccept::allocateThread(EThread*)
360 49.1803 HttpSM.cc:7791 traffic_server traffic_server HttpSM::redirect_request(char const*, int)
36603 8.1552 UnixEThread.cc:41 traffic_server traffic_server EThread::EThread()
36603 100.000 UnixEThread.cc:41 traffic_server traffic_server EThread::EThread() self
-------------------------------------------------------------------------------
13724 3.0577 LogBuffer.cc:356 traffic_server traffic_server LogBuffer::checkout_write(unsigned long*, unsigned long)
13724 100.000 LogBuffer.cc:356 traffic_server traffic_server LogBuffer::checkout_write(unsigned long*, unsigned long) self
-------------------------------------------------------------------------------
11137 2.4813 (no location information) libpthread-2.11.1.so traffic_server pthread_mutex_trylock
11137 100.000 (no location information) libpthread-2.11.1.so traffic_server pthread_mutex_trylock self

Google profiler

This too is a sampling profiler, so it has minimal impact on Traffic Servers performance.

Callgrind

Callgrind is will slow down the performance of traffic server significantly.

  • No labels