Significant performance problem with modprobe

Ed W lists at wildgooses.com
Mon Jun 13 07:47:08 UTC 2011



>> Obviously fixing iptables is desirable, but is it possible to improve performance 
>> of busybox modprobe?  Looking at strace the big difference seems to be the 
>> read of the various files, busybox apparently using lots of getc()?
>>
>> Any thoughts on a solution?
> 
> 
> Apparently upstream tools now use some sort of binary indexed files
> which allow search to be sped up:

Hi, thanks for not forgetting about this.



> There is no fast fix for this: we will need to implement indexed binary files
> to match upstream speed.

Hmm, interesting.  My first estimate was that the per character reading
of the file was slow and hammering me here?  I am on linux and noticed
that there was a (commented out) chunk of code in busybox to use
platform line reads, but I have not experimented with whether that
offers a performance difference

I'm running from an SLC CF card, so if my modules.alias is 137KB and
takes around 0.05s to read, then this is very roughly 2.7MB/s, which
seems a touch on the slow side.  Using "dd" I get approximately 11.3MB/s
from the raw device, but this isn't including the overhead of my
filesystem (squashfs+aufs).

Additionally I'm running the modprobe test many times in a row and I
might expect the block cache to eliminate the disk read time on
subsequent runs?

Therefore low couple of MB/s seems rather a poor read speed for busybox
processing modules.dep from cache?  I still wonder if the single
character read is the bottleneck here? (I notice it's also used in sed,
I could perhaps benchmark that for comparison...)

Thanks for your thoughts

Ed W




More information about the busybox mailing list