avahi-daemon periodically eats CPU 50% more or less in embedded system

View: New views
3 Messages — Rating Filter:   Alert me  

avahi-daemon periodically eats CPU 50% more or less in embedded system

by chen leyn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, there,

I'm recently working on porting Avahi (version 0.6.22) to an embedded Linux (kernel 2.6.17) platform. The job is almost done and we already achieved all the functionalities we want. However, during further testing, we found in some lab that there are heavy Bonjour network traffic (many Mac OS hosts), Avahi-daemon will eat CPU time periodically.

We use strace to find what is happening, and here is the data, seems like the timeout value which avahi calculated for next poll operation is always 0 for a while, not sure whether that's expect behavior and  whether such tight poll loop eat CPU time. Also want to mention that, after we plugged out the network cable, the symptom disappear, after plugged in back, appear again. Even after kill avahi-daemon and restart it, problem is still there.

Any help we can get from here? Thanks in advance!

Strace output:

gettimeofday({1245413575, 779620}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 273) = 0 (Timeout) 
gettimeofday({1245413576, 56667}, NULL) = 0 
gettimeofday({1245413576, 56792}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 57347}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 57675}, NULL) = 0 
gettimeofday({1245413576, 57780}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 58222}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 58542}, NULL) = 0 
gettimeofday({1245413576, 58647}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 59098}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 59417}, NULL) = 0 
gettimeofday({1245413576, 59522}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 59964}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 60283}, NULL) = 0 
gettimeofday({1245413576, 60388}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 60832}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 61152}, NULL) = 0 
gettimeofday({1245413576, 61257}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 61707}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 62026}, NULL) = 0 
gettimeofday({1245413576, 62131}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 62574}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 62894}, NULL) = 0 
gettimeofday({1245413576, 62999}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 63441}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 63760}, NULL) = 0 
gettimeofday({1245413576, 63865}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 64310}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 64638}, NULL) = 0 
gettimeofday({1245413576, 64743}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 65185}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 396475}, NULL) = 0 
gettimeofday({1245413576, 396589}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 397080}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 397406}, NULL) = 0 
gettimeofday({1245413576, 397512}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 397955}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 398276}, NULL) = 0 
gettimeofday({1245413576, 398381}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 398826}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 399156}, NULL) = 0 
gettimeofday({1245413576, 399261}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 399706}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 400026}, NULL) = 0 
gettimeofday({1245413576, 400131}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 400575}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 400895}, NULL) = 0 
gettimeofday({1245413576, 401000}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 401444}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 401773}, NULL) = 0 
gettimeofday({1245413576, 401878}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 402320}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 402640}, NULL) = 0 
gettimeofday({1245413576, 402745}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 403188}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 0 (Timeout) 
gettimeofday({1245413576, 403508}, NULL) = 0 
gettimeofday({1245413576, 403613}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 733699}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413576, 734159}, NULL) = 0 
gettimeofday({1245413576, 734267}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 734752}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413576, 735129}, NULL) = 0 
gettimeofday({1245413576, 735235}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413576, 735682}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 2729) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413576, 736066}, NULL) = 0 
ioctl(11, FIONREAD, [277])              = 0 
recvmsg(11, {msg_name(16)={sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("17.206.113.189")}, msg_iov(1)=[{"\0\0\204\0\0\0\0\5\0\0\0\2#ms3-rack4unit11 [00:"..., 277}], msg_controllen=40, {cmsg_len=24, cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0}, 0) = 277 
gettimeofday({1245413576, 736942}, NULL) = 0 
gettimeofday({1245413576, 737061}, NULL) = 0 
gettimeofday({1245413576, 737164}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 737413}, NULL) = 0 
gettimeofday({1245413576, 737532}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
time(NULL)                              = 1245413576 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 738011}, NULL) = 0 
gettimeofday({1245413576, 738113}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 738354}, NULL) = 0 
gettimeofday({1245413576, 738499}, NULL) = 0 
gettimeofday({1245413576, 738600}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 738839}, NULL) = 0 
time(NULL)                              = 1245413576 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 739216}, NULL) = 0 
gettimeofday({1245413576, 739317}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 739557}, NULL) = 0 
gettimeofday({1245413576, 739690}, NULL) = 0 
gettimeofday({1245413576, 739791}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 740020}, NULL) = 0 
gettimeofday({1245413576, 740144}, NULL) = 0 
gettimeofday({1245413576, 740246}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 740474}, NULL) = 0 
gettimeofday({1245413576, 740596}, NULL) = 0 
gettimeofday({1245413576, 740698}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
read(6, "WWWWWWWWWW"..., 10)            = 10 
read(6, 0x3ecd47c0, 10)                 = -1 EAGAIN (Resource temporarily unavailable) 
gettimeofday({1245413576, 741139}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 497) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413576, 921918}, NULL) = 0 
ioctl(11, FIONREAD, [732])              = 0 
recvmsg(11, {msg_name(16)={sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("17.206.113.189")}, msg_iov(1)=[{"\0\0\204\0\0\0\0\32\0\0\0\0\17ms3-rack4unit11\4_ssh"..., 732}], msg_controllen=40, {cmsg_len=24, cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0}, 0) = 732 
gettimeofday({1245413576, 922635}, NULL) = 0 
gettimeofday({1245413576, 922782}, NULL) = 0 
gettimeofday({1245413576, 922888}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 923149}, NULL) = 0 
gettimeofday({1245413576, 923265}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
time(NULL)                              = 1245413576 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 923750}, NULL) = 0 
gettimeofday({1245413576, 923855}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 924092}, NULL) = 0 
gettimeofday({1245413576, 924210}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
time(NULL)                              = 1245413576 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 924700}, NULL) = 0 
gettimeofday({1245413576, 924805}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 925048}, NULL) = 0 
time(NULL)                              = 1245413576 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 925451}, NULL) = 0 
gettimeofday({1245413576, 925556}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 925793}, NULL) = 0 
gettimeofday({1245413576, 925920}, NULL) = 0 
gettimeofday({1245413576, 926025}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 926268}, NULL) = 0 
time(NULL)                              = 1245413576 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 926684}, NULL) = 0 
gettimeofday({1245413576, 926785}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 927019}, NULL) = 0 
gettimeofday({1245413576, 927167}, NULL) = 0 
gettimeofday({1245413576, 927269}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 927501}, NULL) = 0 
gettimeofday({1245413576, 927614}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
time(NULL)                              = 1245413576 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413576, 928086}, NULL) = 0 
gettimeofday({1245413576, 928187}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 259103}, NULL) = 0 
gettimeofday({1245413577, 259287}, NULL) = 0 
gettimeofday({1245413577, 259394}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 259672}, NULL) = 0 
time(NULL)                              = 1245413577 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 260101}, NULL) = 0 
gettimeofday({1245413577, 260206}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 260444}, NULL) = 0 
gettimeofday({1245413577, 260583}, NULL) = 0 
gettimeofday({1245413577, 260688}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 260928}, NULL) = 0 
gettimeofday({1245413577, 261078}, NULL) = 0 
gettimeofday({1245413577, 261182}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 261420}, NULL) = 0 
gettimeofday({1245413577, 261537}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
time(NULL)                              = 1245413577 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 262040}, NULL) = 0 
gettimeofday({1245413577, 262145}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 262383}, NULL) = 0 
gettimeofday({1245413577, 262545}, NULL) = 0 
gettimeofday({1245413577, 262650}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 262893}, NULL) = 0 
time(NULL)                              = 1245413577 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 263298}, NULL) = 0 
gettimeofday({1245413577, 263403}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 263639}, NULL) = 0 
gettimeofday({1245413577, 263802}, NULL) = 0 
gettimeofday({1245413577, 263907}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 264146}, NULL) = 0 
gettimeofday({1245413577, 264309}, NULL) = 0 
gettimeofday({1245413577, 264422}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 264661}, NULL) = 0 
gettimeofday({1245413577, 264780}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
time(NULL)                              = 1245413577 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 265289}, NULL) = 0 
gettimeofday({1245413577, 265394}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 265631}, NULL) = 0 
gettimeofday({1245413577, 265800}, NULL) = 0 
gettimeofday({1245413577, 265905}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 266147}, NULL) = 0 
time(NULL)                              = 1245413577 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 266605}, NULL) = 0 
gettimeofday({1245413577, 266707}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 266940}, NULL) = 0 
gettimeofday({1245413577, 267108}, NULL) = 0 
gettimeofday({1245413577, 267209}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 267439}, NULL) = 0 
gettimeofday({1245413577, 267596}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 267820}, NULL) = 0 
gettimeofday({1245413577, 267922}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 268153}, NULL) = 0 
gettimeofday({1245413577, 268297}, NULL) = 0 
gettimeofday({1245413577, 268399}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 268627}, NULL) = 0 
gettimeofday({1245413577, 268778}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 268998}, NULL) = 0 
gettimeofday({1245413577, 269099}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 269326}, NULL) = 0 
gettimeofday({1245413577, 269492}, NULL) = 0 
gettimeofday({1245413577, 269594}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
gettimeofday({1245413577, 599593}, NULL) = 0 
gettimeofday({1245413577, 599777}, NULL) = 0 
gettimeofday({1245413577, 599885}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
read(6, "WWWWWWWWWW"..., 10)            = 10 
read(6, "WWWWWWWWWW"..., 10)            = 10 
read(6, "WWWWWWWWWW"..., 10)            = 10 
read(6, "WWWWWWWWWW"..., 10)            = 10 
read(6, "WWW"..., 10)                   = 3 
gettimeofday({1245413577, 600692}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 601097}, NULL) = 0 
gettimeofday({1245413577, 601202}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 601664}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 602040}, NULL) = 0 
gettimeofday({1245413577, 602146}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 602587}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 602964}, NULL) = 0 
gettimeofday({1245413577, 603069}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 603513}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 603889}, NULL) = 0 
gettimeofday({1245413577, 603995}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 604445}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 604822}, NULL) = 0 
gettimeofday({1245413577, 604927}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 605369}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 605746}, NULL) = 0 
gettimeofday({1245413577, 605852}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 606296}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 606721}, NULL) = 0 
gettimeofday({1245413577, 606823}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 607261}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 939040}, NULL) = 0 
gettimeofday({1245413577, 939238}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 939729}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 940131}, NULL) = 0 
gettimeofday({1245413577, 940236}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 940683}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 941060}, NULL) = 0 
gettimeofday({1245413577, 941165}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 941611}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 941997}, NULL) = 0 
gettimeofday({1245413577, 942102}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 
gettimeofday({1245413577, 942544}, NULL) = 0 
poll([{fd=6, events=POLLIN}, {fd=13, events=POLLIN}, {fd=12, events=POLLIN}, {fd=11, events=POLLIN}, {fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 6, 0) = 1 ([{fd=11, revents=POLLIN}]) 
gettimeofday({1245413577, 942921}, NULL) = 0 
gettimeofday({1245413577, 943026}, NULL) = 0 
write(7, "W"..., 1)                     = 1 
write(7, "W"..., 1)                     = 1 
read(6, "WW"..., 10)                    = 2 


Regards,
Leyn

_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: avahi-daemon periodically eats CPU 50% more or less in embedded system

by Lennart Poettering-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 24.06.09 12:11, chen leyn (leyncl@...) wrote:

> Hi, there,
> I'm recently working on porting Avahi (version 0.6.22) to an embedded Linux
> (kernel 2.6.17) platform. The job is almost done and we already achieved all
> the functionalities we want. However, during further testing, we found in
> some lab that there are heavy Bonjour network traffic (many Mac OS hosts),
> Avahi-daemon will eat CPU time periodically.
>
> We use strace to find what is happening, and here is the data, seems like
> the timeout value which avahi calculated for next poll operation is always 0
> for a while, not sure whether that's expect behavior and  whether such tight
> poll loop eat CPU time. Also want to mention that, after we plugged out the
> network cable, the symptom disappear, after plugged in back, appear again.
> Even after kill avahi-daemon and restart it, problem is still there.
>
> Any help we can get from here? Thanks in advance!

No clue, except maybe that gdb or even oprofile might be a more useful
tool here.

I fear you have to track that one down yourself, as I haven't had any
report about this before.

Sorry,

LennartLennart

--
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: avahi-daemon periodically eats CPU 50% more or less in embedded system

by chen leyn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Lennart,

Thanks for your informaiton.

Looked into it deeper, it might not be a bug of Avahi, just hundred hosts in the same network which periodically sending Multicast package might be a heavy load to avahi-daemon, which is running in an embedded system.

In my case, seems like too many network traffic causes too many avahi internal time events been created, between a very tiny interval. Just wonder whether it's possible to change below place to optimize this condition in my case (given that I don't need to consider about Apple Bonjour compliance test right now)?

#define AVAHI_RESPONSE_JITTER_MSEC 500

Thanks!

Leyn

2009/6/29 Lennart Poettering <lennart@...>
On Wed, 24.06.09 12:11, chen leyn (leyncl@...) wrote:

> Hi, there,
> I'm recently working on porting Avahi (version 0.6.22) to an embedded Linux
> (kernel 2.6.17) platform. The job is almost done and we already achieved all
> the functionalities we want. However, during further testing, we found in
> some lab that there are heavy Bonjour network traffic (many Mac OS hosts),
> Avahi-daemon will eat CPU time periodically.
>
> We use strace to find what is happening, and here is the data, seems like
> the timeout value which avahi calculated for next poll operation is always 0
> for a while, not sure whether that's expect behavior and  whether such tight
> poll loop eat CPU time. Also want to mention that, after we plugged out the
> network cable, the symptom disappear, after plugged in back, appear again.
> Even after kill avahi-daemon and restart it, problem is still there.
>
> Any help we can get from here? Thanks in advance!

No clue, except maybe that gdb or even oprofile might be a more useful
tool here.

I fear you have to track that one down yourself, as I haven't had any
report about this before.

Sorry,

LennartLennart

--
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi


_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi