ar performing abysmally

Brooks Davis brooks at freebsd.org
Tue Oct 14 15:05:33 UTC 2014


On Tue, Oct 14, 2014 at 01:12:05AM -0500, Jim Bell wrote:
> Upgraded to FreeBSD-10/gcc48. One project puts a dozen object files in a 
> static lib via ar, but now that takes a long time, and it's not CPU.
> 
> ?time ar -v -c -u -q ...? : 362.62 real         0.11 user 0.82 sys.
> ?time ar -v -c -r -u -s ...?: 407.94 real         0.13 user 0.80 sys
> 
> iostat's numbers don't look to impressive to me, but my ISP says they're 
> normal. 'dd' writes to the disk plenty fast. I moved off the RAID-1 but 
> it made no difference. I have 64G swap and it doesn't get touched.
> 
> Truss shows it reading the input files and writing the output, but write 
> times are all over the place. truss -D ...
> 0.000031869 write(3,...,10240) = 10240 (0x2800)
> 0.083054581 write(3,...,10240) = 10240 (0x2800)
> 0.000029723 write(3,...,10240) = 10240 (0x2800)
> 0.841429575 write(3,...,10240) = 10240 (0x2800) <-- seems pretty slow!
> 0.000015954 write(3,...,10240) = 10240 (0x2800)
> 0.000022723 write(3,...,10240) = 10240 (0x2800)
> 
> Truss shows 800 write's that take over 0.7 sec, similar to the above.
> 
> Where's my problem? What to try next? Is it even the disk?

If you want to eliminate the disk as possible source I'd try doing the ar
run on a memory disk if the inputs will fit (you should be able to send
the output to /dev/null).

It's worth noting that ar doesn't really do anything particularly
complicated, the FreeBSD one is implemented in libarchive.  With
newer gcc ports it is possiable that you're using the GNU ar from
devel/binutils which may be doing something more complex for some
reason.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-performance/attachments/20141014/1c6edb8d/attachment.sig>


More information about the freebsd-performance mailing list