High Idle wakeups

77 views
Skip to first unread message

Om Narayan

unread,
May 20, 2023, 10:47:40 PM5/20/23
to golang-nuts
Hi, 

My command line tools is crashing on mac machine ( both intel and M1) and its working fine on even raspberry pi 4b. 

Issue -  apple is killing my app with reason '45001 wakeups over the last 140 seconds'


My command like tool is making around 50-100 tcp calls to local tcp server and few rest call in 10 seconds. 

I have tried lot to improve it but no luck, 

I wrote a simple code to create 10k tcp connection,  both in Go and Python, go code is ending up high idle wakeups and python one with zero. 


Sample Code  - Go 


func main() {
time.Sleep(10*time.Second) // added sleep to make sure it run enough to show in mac activities monitor
for count < 10000 {
count += 1
netConn, err := dialer.Dial("tcp", ":8080")
if err == nil {
netConn.Close()
}
}

time.Sleep(10*time.Second) // added sleep to make sure it run enough to show in mac activities monitor

}



Python Code

import time
import socket


time.sleep(10)

index = 0
while index < 10000:
index += 1
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("127.0.0.1", 8080))
conn.close()
print (index)
# print(index, device.shell("ls /data/local/tmp"))


time.sleep(10)




.. Om 

Reply all
Reply to author
Forward
0 new messages