Jump to content

Utorrent 1.6 works under Unix (FreeBSD 6.1)


deathnoise

Recommended Posts

  • 2 weeks later...

I was messing around with utorrent 1.6 under wine..

with new version Wine 0.9.24 and freebsd tuning i accomplished reduce of cpu usage from 25-40% to.. amazing 0.05% (!!!!).

at least it's what "top" is showing. It's now working better under freebsd than under windows itself.

from visible changes, utorrent doesn't freeze anymore every 5 minutes

here are changes that i made:

/etc/sysctl.conf

kern.ipc.somaxconn=16384

kern.ipc.nmbclusters=32768

kern.ipc.maxsockets=32768

kern.ipc.maxsockbuf=16777216

net.inet.tcp.rfc1323=1

net.inet.tcp.sendspace=1048576

net.inet.tcp.recvspace=1048576

kern.maxfiles=65536

kern.maxfilesperproc=32768

#security.bsd.see_other_uids=0

net.inet.ip.check_interface=1 # protection against spoof ip packets

#net.inet.ip.random_id=1

#net.inet.ip.fastforwarding=1

#net.inet.ip.process_options=0

net.inet.icmp.maskrepl=0

net.inet.tcp.rfc3042=1 # Enhancing TCP's Loss Recovery Using Limited Transmit

net.inet.tcp.rfc3390=1 # Increasing TCP's Initial Window

net.inet.tcp.sack.enable=1

net.inet.tcp.delayed_ack=0

net.inet.tcp.keepidle=300000

net.inet.tcp.keepintvl=150

net.inet.udp.recvspace=65535

net.inet.udp.blackhole=1

net.inet.udp.maxdgram=57344

net.local.stream.recvspace=65535

net.local.stream.sendspace=65535

/boot/loader.conf

kern.ipc.maxsockets="32768"

/etc/rc.conf

# hi perf config

log_in_vain="1"

icmp_bmcastecho="NO"

icmp_drop_redirect="YES"

tcp_keepalive="YES"

tcp_drop_synfin="YES"

tcp_extensions="YES" # RFC 1323 - TCP Extensions for High Performance

fsck_y_enable="YES"

check_quotas="NO"

#kern_securelevel_enable="YES"

#kern_securelevel="1"

clear_tmp_enable="YES"

virecover_enable="NO"

update_motd="NO"

# end of hi perf config

my comp. specs: Athlon 2400xp+, 1gb ram, nforce 2

I hope it helps

Link to comment
Share on other sites

Do you have any idea which one that made CPU usage went down? A few of lines in your sysctl.conf are not need, because those are enabled by default. Thanks for hunt to get CPU usage reduce!

# sysctl -a | grep rfc1323

net.inet.tcp.rfc1323: 1

# sysctl -a | grep rfc3042

net.inet.tcp.rfc3042: 1

# sysctl -a | grep rfc3390

net.inet.tcp.rfc3390: 1

# sysctl -a | grep sack\.enable

net.inet.tcp.sack.enable: 1

goes on

Link to comment
Share on other sites

i think it's because of config var's related to limit number of open file/socket descriptors.. FreeBSD has default number of descriptors set at 1024.. it's a way too low, if you want to run p2p service, so setting it up around 32000 did the trick. i think that these variables are responsible:

/etc/sysctl.conf

kern.ipc.somaxconn=16384

kern.ipc.nmbclusters=32768

kern.ipc.maxsockets=32768

kern.maxfiles=65536

kern.maxfilesperproc=32768

/boot/loader.conf

kern.ipc.maxsockets="32768"

[dunno, if this variable should be set in loader.conf or in sysctlg.conf]

i was messing also with headers, and made some changes:

changed FD_SETSIZE up to 65536U in:

/usr/src/sys/sys/select.h

/usr/include/sys/select.h

changed

SOMAXCONN up to 16384 in:

/usr/include/sys/socket.h

/usr/src/sys/sys/socket.h

then:

cd /usr/src

make clean && make cleandepend

make buildworld && make installworld

make buildkernel && make installkernel

reboot

i'm using my system for network programming (multi agents, databases, fastcgi stuff, etc).

about default enabled var's - i choosed to enforce these values, because the default ones are sometimes changing, without prior notice from BSD developers ;)

p.s [little off-topic]

many people don't know, that apache bench is limited by config variable that is setting the number of the open file descriptors, so it would never show results better/higher than 1600 req/sec

i just made changes described above and after recompilation of httperf (another benchmarking program, without limits of apache), i'm gettings results around 2700 req/sec for simple fastcgi C dynamic, multi-threaded WWW application.

try this with PHP, hehe.

Oh, and I think that this post should be pinned for all people, that have problems with heavy load under FreeBSD. This could be a solution for their problems.

Link to comment
Share on other sites

Thanks! I did a bit of homework and found out about that wine developers have committed in wine.git for replace from select() to poll(). It should help with the file descriptors limit issue.

http://comments.gmane.org/gmane.comp.emulators.wine.devel/46488

You can visit in the above link to collect which files and visit in http://source.winehq.org/git/ to either check history or grab the changes. I can either grab the changes or wait for the next version. Hopeful, it will fixing this CPU usage issue.

changed FD_SETSIZE up to 65536U in:

/usr/src/sys/sys/select.h

/usr/include/sys/select.h

Umm, I think I will go with redefine method in wine's source code instead poke around in the system. :-)

Link to comment
Share on other sites

The patches of replace from select() to poll() do not solve the CPU usage. I have figured out whicn one in your list of sysctl.conf to get CPU usage reduce by following add these lines below in sysctl.conf.

kern.ipc.maxsockbuf=16777216
net.inet.tcp.rfc1323=1
net.inet.tcp.sendspace=1048576
net.inet.tcp.recvspace=1048576

I think, the values are a bit too high. I have reduced to 512kb and seems work so far. I will try to go more lower to maybe like 64kb if it possible. I do not know how much utorrent needs the kb.

Link to comment
Share on other sites

  • 3 weeks later...

hi, I also have freebsd6.1, amd2500+ 1gbram pc. I set all the settings in /etc/sysctl.conf , but got a problem with utorrent running in wine. With few torrents it works fine, but now i have 50torrents and it's really slow.

At the moment:

25.88% wineserver

22.95% wine

Didn't configure wine, left it with default settings. Is there any way to make utorrent work ok with such amount of torrents? Because on freebsd you don't have a lot of options in choosing a bittorrent client :( ktorrent and azureus only, but they have many issues. Thou would be greate if utorrent developers would make it for unix operating systems, because I think it's the best bittorrent client at the moment :)

Link to comment
Share on other sites

Any idea how much work it takes to make a decent client? Let me tell you, it's not like it's done in a couple of months. Not to mention if you want it to be of the same class as the other bigger clients out there at some point. Nah, if the utorrent developers want to make an unix client i rather think they better either fork KTorrent, or stick heads together with the KTorrent camp in some way.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...