It looks like there are some data races in your code

http://paste.ubuntu.com/23945891/

It's not possible to debug runtime problems until there are no data races.

On Tuesday, 7 February 2017 16:07:55 UTC+11, Dave Cheney wrote:
>
> > Since there is nothing that changes in the processes over time, the 
> fact that it kicks in after a few minutes makes me think it may be a 
> garbage collection issue.   
>
> Running with GODEBUG=gctrace=1 will confirm / deny this hypothesis.
>
> On Tuesday, 7 February 2017 16:06:09 UTC+11, Jason E. Aten wrote:
>>
>>
>> On linux/amd64 using go1.8rc3, I'm seeing one Go built process peg one 
>> cpu to 100% after running for a few minutes.
>>
>>
>> Tasks: 499 total,   1 running, 497 sleeping,   0 stopped,   1 
>> zombie                                                                       
>>                                                                
>>
>> %Cpu(s):  2.8 us,  3.5 sy,  0.0 ni, 93.7 id,  0.0 wa,  0.0 hi,  0.0 si,  
>> 0.0 
>> st                                                                           
>>                                                 
>>
>> KiB Mem : 12356040+total, 65169064 free,  5018704 used, 53372628 
>> buff/cache                                                                   
>>                                                             
>>
>> KiB Swap:        0 total,        0 free,        0 used. 11790566+avail 
>> Mem                                                                          
>>                                                       
>>
>>                                                                              
>>                                                                              
>>                                                 
>>
>>   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ 
>> COMMAND                                                                      
>>                                                          
>>
>>   84359 jaten     20   0 1156916  52152   4632 S 100.7  0.0   9:05.82 
>> vhaline -info -web -addr 
>> loc+                                                                         
>>                               
>>
>>   84486 jaten     20   0  941964  19884   4268 S   0.7  0.0   0:05.58 
>> vhaline -info -addr 
>> localhos+                                                                    
>>                                    
>>
>>   84501 jaten     20   0 1020484  14712   4216 S   0.7  0.0   0:04.95 
>> vhaline -info -addr localhos+   
>>
>>
>> when I profile, I get alot fo runtime._ExternalCode. What is that and 
>> what does it mean?
>>
>> $ go tool pprof --nodefraction=0.1 vhaline 
>> ./profile.cpu.runaway.rootnode                                   
>> Entering interactive mode (type "help" for 
>> commands)                                                                    
>>       
>>
>> (pprof) 
>> top10                                                                        
>>                                          
>>
>> 21.16s of 29.97s total 
>> (70.60%)                                                                     
>>                           
>>
>> Dropped 55 nodes (cum <= 
>> 3s)                                                                          
>>                         
>>
>> Showing top 10 nodes out of 16 (cum >= 
>> 10.61s)                                                                      
>>           
>>
>>       flat  flat%   sum%        cum   
>> cum%                                                                         
>>            
>>
>>     13.55s 45.21% 45.21%     13.55s 45.21%  
>> runtime._ExternalCode                                                        
>>      
>>
>>      6.23s 20.79% 66.00%      7.85s 26.19%  
>> syscall.Syscall                                                              
>>      
>>
>>      0.27s   0.9% 66.90%     16.42s 54.79%  
>> github.com/glycerine/vhaline/vhaline.(*srvReader).start.func1                
>>      
>>
>>      0.25s  0.83% 67.73%     10.20s 34.03%  
>> net.(*netFD).Read                                                            
>>      
>>
>>      0.23s  0.77% 68.50%      3.96s 13.21%  
>> net.setDeadlineImpl                                                          
>>      
>>
>>      0.20s  0.67% 69.17%     10.96s 36.57%  
>> bufio.(*Reader).Peek                                                         
>>      
>>
>>      0.12s   0.4% 69.57%     10.76s 35.90%  
>> bufio.(*Reader).fill                                                         
>>      
>>
>>      0.11s  0.37% 69.94%     11.09s 37.00%  
>> github.com/glycerine/tmframe2.(*FrameReader).NextFrame                       
>>      
>>
>>      0.11s  0.37% 70.30%      7.96s 26.56%  
>> syscall.read                                                                 
>>      
>>
>>      0.09s   0.3% 70.60%     10.61s 35.40%  
>> net.(*conn).Read                                                             
>>      
>>
>> (pprof)  
>>
>> source code is here; the processes can be built from 
>> https://github.com/glycerine/vhaline  at commit commit 
>> ca32a98799b87627798e05bb8e6cc29d9cac7ec3 or using tag "runaway".
>>
>> pprof profiling was turned on; could this account for this peg?
>>
>> I was running three vhaline processes in a chain; the cpu peg happened to 
>> the first process, but I've also seen it happen for the 2nd.
>>
>> they were started like this, in three separate shells
>> $ vhaline -info -web -addr localhost:9000                          # 
>> process 84359
>> $ vhaline -info -addr localhost:9001 -parent localhost:9000 -cpu   # 
>> process 84486
>> $ vhaline -info -addr localhost:9002 -parent localhost:9001 -cpu   # 
>> process 84501
>>
>> Since there is nothing that changes in the processes over time, the fact 
>> that it kicks in after a few minutes makes me think it may be a garbage 
>> collection issue.                                                            
>>                                         
>>
>>
>>      
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to