Ronald Klop
2011-Sep-18 00:08 UTC
/usr/bin/script eating 100% cpu with portupgrade and xargs
Hi, I'm running portupgrade in screen to update all the ports for 9-BETA2/9-CURRENT on amd64. While doing this script eats 100% cpu. Because portupgrade -fa crashed I'm running this command to update the remaining non-updates ports. find /var/db/pkg -name +DESC -mtime +2 |cut -d / -f 5 | xargs time nice -n 20 portupgrade -f The output of truss -p `pgrep script` is this: clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) read(0,0x7fffffffcdf0,1024) = 0 (0x0) write(4,0x7fffffffcdf0,0) = 0 (0x0) clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) read(0,0x7fffffffcdf0,1024) = 0 (0x0) write(4,0x7fffffffcdf0,0) = 0 (0x0) clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) read(0,0x7fffffffcdf0,1024) = 0 (0x0) write(4,0x7fffffffcdf0,0) = 0 (0x0) clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) read(0,0x7fffffffcdf0,1024) = 0 (0x0) write(4,0x7fffffffcdf0,0) = 0 (0x0) So it is really fast in reading and writing 0 bytes most of the time. I also found http://web.archiveorange.com/archive/v/6ETvLvjo60Gj9geAUAb6 and I think I am better of by rewriting my command so stdin/stdout is still the terminal. Although the link is a couple of years old. Is this known? Can somebody explain me why my xargs command is not working well? Ronald.
Jason Hellenthal
2011-Sep-18 04:54 UTC
/usr/bin/script eating 100% cpu with portupgrade and xargs
On Sun, Sep 18, 2011 at 01:49:15AM +0200, Ronald Klop wrote:> Hi, > > I'm running portupgrade in screen to update all the ports for > 9-BETA2/9-CURRENT on amd64. While doing this script eats 100% cpu. > Because portupgrade -fa crashed I'm running this command to update the > remaining non-updates ports. > find /var/db/pkg -name +DESC -mtime +2 |cut -d / -f 5 | xargs time nice -n > 20 portupgrade -f > > The output of truss -p `pgrep script` is this: > clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) > read(0,0x7fffffffcdf0,1024) = 0 (0x0) > write(4,0x7fffffffcdf0,0) = 0 (0x0) > clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) > read(0,0x7fffffffcdf0,1024) = 0 (0x0) > write(4,0x7fffffffcdf0,0) = 0 (0x0) > clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) > read(0,0x7fffffffcdf0,1024) = 0 (0x0) > write(4,0x7fffffffcdf0,0) = 0 (0x0) > clock_gettime(13,{1316301104.000000000 }) = 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) = 1 (0x1) > read(0,0x7fffffffcdf0,1024) = 0 (0x0) > write(4,0x7fffffffcdf0,0) = 0 (0x0) > > So it is really fast in reading and writing 0 bytes most of the time. > > I also found http://web.archiveorange.com/archive/v/6ETvLvjo60Gj9geAUAb6 > and I think I am better of by rewriting my command so stdin/stdout is > still the terminal. Although the link is a couple of years old. > > Is this known? Can somebody explain me why my xargs command is not working > well? >Are you absolutely sure that its script(1) causing this ? 100% CPU usage has been a known side effect of screen(1) for quite some time. Rebuild it and try again. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 522 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20110918/c487bf93/attachment.pgp
Ross
2011-Oct-23 11:35 UTC
Running portupgrade from cron (was: /usr/bin/script eating 100% cpu with portupgrade and xargs)
On Sun, Oct 23, 2011 at 2:14 PM, Stefan Bethke <stb@lassitu.de> wrote:> Am 23.10.2011 um 13:11 schrieb Ross: > >> On Sun, Oct 23, 2011 at 1:32 PM, Stefan Bethke <stb@lassitu.de> wrote: >>> Am 23.10.2011 um 08:47 schrieb Chris Rees: >>> >>>> Worst of all, you're running portupgrade from cron without reading UPDATING, >>>> which is just asking for trouble. >>> >>> What specifically is your concern here? >> >> And what you will get with ignoring /usr/ports/UPDATING when this happens: >> 20100328: >> AFFECTS: users of graphics/png >> AUTHOR: dinoex@FreeBSD.org >> >> The PNG library has been updated to version 1.4.1. Please rebuild all >> ports that depend on it. > > And where exactly did I say that I never read UPDATING, and that I wouldn't follow it's instructions?Yes, but updating correctly in first place is better than trying to understand what happened to software looking for libpng.so.N when there is libpng.so.N+1 and _then_ reading UPDATING is better, don't you think? Other point is that during update daemons never restarted. But sometimes stopped, dovecot, for example, if I'm not mistaken. Do you also reboot after each cron update?> > > Stefan > > -- > Stefan Bethke <stb@lassitu.de> ? Fon +49 151 14070811 > > > >