Date: Thu, 03 May 2012 14:04:59 -0500 From: Bryan Drewery <bryan@shatow.net> To: Yanhui Shen <shen.elf@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: CPU usage so high, fread() on the FILE wrapped by libfetch's fetchXGetURL() Message-ID: <4FA2D6DB.70404@shatow.net> In-Reply-To: <CAEEM4vkZEopsP=2BCwunQ-dw5SEHE=yUC1xihyZYM=GZdXAvEg@mail.gmail.com> References: <CAEEM4vkZEopsP=2BCwunQ-dw5SEHE=yUC1xihyZYM=GZdXAvEg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/22/2012 06:54 AM, Yanhui Shen wrote: > Hi, > > I found the CPU usage is pretty high while running 'pkg update', > 'pkg install [fooapp]'. Seems it was caused by fread() on the FILE > wrapped by libfetch's fetchXGetURL() , maybe fetch_read() in > common.c. > > Here is a simple test code: http://pastebin.com/2sP1f4Wv I want to > know whether it is a bug, or misuse of libfetch API, or any other > matter? > > Run and look about its CPU usage (HTTP url has this issue, FTP url > has not): % ./a.out > http://mirrors.163.com/FreeBSD/ISO-IMAGES-amd64/8.3/FreeBSD-8.3-RELEASE-amd64-bootonly.iso > > Env: % uname -a FreeBSD ThinkPad 9.0-STABLE FreeBSD 9.0-STABLE #1: > Tue Apr 10 12:46:50 CST 2012 > shen@ThinkPad:/usr/obj/usr/src/sys/ThinkPad amd64 > Turns out that setting fetchTimeout > 0 fixes this problem. It's been set to 30 in pkgng now. Regards, Bryan Drewery -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJPotbaAAoJEG54KsA8mwz5WxUP/iSMjLAShaF/t9+WYtj10FPK 7WWnFj1iquJYN+g0JCDtFnzpqB/VvEfY9sTLqKp/TxCBePS1qPHExzXw9vbFMBDK Em2LCZrlva5vNX7U0vx77dFUJXAEW8zLs6XFeDsmlUBK9CYDK7mDoxNKcLq3LV9w QWOhiTpTe2RprRMqz9FOhQmZ2dB9t5oSuG8BgcEWTfnGS8ANPM45wGH7Vhimai1z 8OCw0T8ZAI7KqDyvxZigACIRWIRb02vBuzVAG1g6EgoVlYQQOwAtH7aCrXaauzlX uWHTjJZYdAl2Lrl60q7qYfyjwFgyVnQIJCEijmT/ydvOMT4huTQrHXvMUiez9qPU wri+6UefQY61C+TVtLMROWlBuCuH4japwxyIlf8QdLbruehcnHjTpFyHDzJMmAj5 V2YU+EfgjOVhoSKyOIQC5VBqK27FlaFMuisD4xisdpJDCJ9k8/LsAjH/PsQwdvei a6CEn3SpMAzrhF3ukv57xIwxSDXdsyoU2VhED5rmrtqzrEFvFjMlflg9MWWHx2m1 KUgmj0ls+WugJrFw/E7PzRU8Qd0xCQRvplDYde16Kzkz+hpXpV6LBYQfWG+YnrRx 5kiJhvNrr7Dstv7Q8u9jNu17KZGSI5p5+FX5oereKymlFxl42rKwyguLXAfHDCXP 1R/HHmtqFSNjSgICw4uC =qd8F -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FA2D6DB.70404>