Thursday, November 1, 2012

Fixing Skype's high CPU usage


From http://billxinli.com/2011/12/14/fixing-skypes-high-cpu-usage/

I brought home a new MacBookPro the other day (well yesterday) It had nothing but a clean install of 10.7.2, I installed Skype, and did a bit of video calling, to my surprise it was using over 300% of the CPU. Unless if it is solving the cure to cancer, that should not happen.

I tried multiple versions of the software, and they were all taking up the same amount of CPU cycles.

The fix hack:

I realized that Skype uses peer to peer with supernode peers for call routing. I have a Rogers extreme connection, without a firewall, and my IP for the mac placed in the DMZ.



I enabled the Mac OSX Firewall, and disallowed incoming connections to Skype, so now I can video chat, and as well have the CPU stable at around 60% instead of 300+%



However, I noticed that Skype will automatically switch to HD Video when there is enough bandwidth, and there is no way to limit that. 1.2mbps video for an hour is 4.2 gigabytes. Imagine someone in a long distance relationship.

Anyhow, I use a Mac, and using ipfw I am able to limit the bandwidth used by Skype, thus it should not show HD videos anymore, and effectively also lowering the CPU temperature.

The two rules that limits my Skype to only use 70kilobyes per second. (246 megabytes/h)

ipfw pipe 55555 config bw 70KByte/s
ipfw add 55555 pipe 55555 src-port 5665 #the port Skype is using

2 comments:

  1. I'd be curious how you resolved which ports to set in the ipfw lines, I was able to get my CPU usage down to reasonable between clearing the user Application Support directory and enabling the firewall, but would love to bring it down to SD.

    ReplyDelete
  2. I didn't. I got it from
    http://billxinli.com/2011/12/14/fixing-skypes-high-cpu-usage/

    However I think that the terminal is your friend. Google it.

    ReplyDelete