mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-users] MLDonkey stable high cpu usage


From: Giacomo Di Ciocco
Subject: [Mldonkey-users] MLDonkey stable high cpu usage
Date: Wed, 26 Nov 2003 02:44:29 +0100

HI all,

Im running MLdonkey for my gf in one of my servers from about a month ago, it works really good but has one problem, the cpu usage, it raise the load avg of a Duron 700mhz machine from 0.4 to about 4.x and its stats on “ps” where of about 30-60% with a renice of 20, I tried to tell this to my gf but she wasn’t according to me :P

So today I started to look at how mldonkey works, after some ltracing I seen it was doing socket polling with no delay :P

I walked a bit in the mldonkey sources and I found this around line 383 of src/utils/net/basicSocket.ml:

 

  while true do

    try

      let time = update_time () in

   (continues)

 

Without knowledge of ocaml (nice lang, im going to learn it) I supposed that this loop regulates the socket polling in mldonkey, as everyone can see this loop has no delay.

A momentary solution can be to place a delay in this loop, so I added:

 

external usleep: int -> unit = "usleep" ;;

 

at the begin of basicSocket.ml and I modified the code in:

 

  while true do

    try

      usleep(50000);

      let time = update_time () in

 

this means a pause of 50000 microseconds between pollings, this reduces the cpu load from 30%/60% to 0.7% in my machine, where my mldonkey is full of downloads to do, with this change I was still able to reach 250KB/sec down and 250KB/sec up which is the maximum for this server, so it shouldn’t penalize performance.

 

Obviously this isn’t an elegant solution and I am not an mldonkey developer, it was just an hint, tell thanks to my gf :P

 

Hoping this will help mldonkey community.

 

Bye, Giacomo.

 

 -------------------------------------------
Giacomo Di Ciocco
Nectarine Administrator
Web:
http://www.nectarine.info
E-Mail: address@hidden
Tel: 0577663107
 -------------------------------------------

 


------------------------------------------
L'utente che ti ha inviato questa email ha a disposizione:

Spazio illimitato, Webmail, accesso Imap, Pop3 e Smtp,
3 differenti domini, protezione antispam e antivirus,
dimensione massima allegati 200mb.

Il tutto totalmente gratuito, la tua email ha queste funzionalità ?
Registrati adesso: http://registrati.nectarine.info
------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]