sort…

August 9, 2009 9:35 pm GMT-0700 | In Tech

I recently noticed CentOS 5.3’s sort is way slower than Ubuntu 9.04’s. Apparently the i18n patch used in coreutils-5.97 CentOS rpm is a performance killer:

$ LANG=C time -p sort --buffer-size=128M -n -k1 -k2 test.info > /dev/null
real 92.58
user 86.04
sys 6.52
$ time -p sort --buffer-size=128M -n -k1 -k2 test.info > /dev/null
real 463.04
user 456.01
sys 6.64

P.S. grep and other locale sensitive utilities have similar issue.

BTW, if your disk is slow, --buffer-size is a parameter you might want to play with to optimize performance. By default sort uses very conservative buffer size while your seemingly used memory is actually just used for cache. [ref]

Tags: , , ,

1 Comment »

RSS feed for comments on this post.

  1. I have a server running RHEL and do a daily sort job, I think I should compile a coreutils and see…

    Comment by fishy — August 9, 2009 10:25 pm GMT-0700 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This weblog is licensed under a Creative Commons License.
Powered by WordPress. Theme based on Pool by Borja Fernandez.