On Tue, May 29, 2012 at 11:51 PM, gjohnson <[email protected]> wrote: > I am attempting to debug random slowness in an application and before I > google the web too much, I thought I'd ask here: > > % time seconds usecs/call calls errors syscall > ------ ----------- ----------- --------- --------- ---------------- > 32.37 0.027971 2 14698 epoll_wait > 29.50 0.025491 1 22815 write > 18.92 0.016346 1 29406 clock_gettime > 13.43 0.011601 1 14424 read > 4.81 0.004154 18 229 mmap > 0.36 0.000311 2 140 munmap > 0.21 0.000184 4 52 2 epoll_ctl > 0.18 0.000152 1 164 80 open > 0.12 0.000106 1 200 futex > 0.10 0.000083 1 88 close > 0.00 0.000000 0 84 fstat > 0.00 0.000000 0 4 socket > 0.00 0.000000 0 4 4 connect > 0.00 0.000000 0 8 setsockopt > 0.00 0.000000 0 4 getsockopt > 0.00 0.000000 0 4 uname > 0.00 0.000000 0 8 fcntl > 0.00 0.000000 0 20 sysinfo > ------ ----------- ----------- --------- --------- ---------------- > 100.00 0.086399 82352 86 total > > The connect() errors stem from redis, but from what I gather a EINPROGRESS > is not a bad thing... > [pid 8039] connect(53, {sa_family=AF_INET, sin_port=htons(6379), > sin_addr=inet_addr("10.24.24.122")}, 16) = -1 EINPROGRESS (Operation now in > progress) > > These open() errors confuse me: > [pid 8032] open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", > O_RDONLY) = -1 ENOENT (No such file or directory) > [pid 8032] open("/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq", > O_RDONLY) = -1 ENOENT (No such file or directory) > [pid 8032] open("/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq", > O_RDONLY) = -1 ENOENT (No such file or directory) > [pid 8032] open("/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_max_freq", > O_RDONLY) = -1 ENOENT (No such file or directory) > > I was not able to capture the epoll_ctl errors... > > Any thoughts?
Try the built-in profiler, it gives you a breakdown on both JS and C/C++ code. Make sure your program isn't idle much or you'll get skewed results like in the strace stats you posted - that 32.37% CPU time spent in epoll_wait is idle time. EINPROGRESS is a benign error message, it means that the TCP handshake is not yet complete. The ENOENT errors is os.cpus() trying to read out the CPU status. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
