-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday, 2013-06-19 at 04:57 -0700, Linda Walsh wrote:
Carlos E. R. wrote:
You see a 30MB file, I see
30 units of a 1MB stripe size. Spindle-numbers are to disks as cores are to cpu's.
Yes, but still the kernel provides one read operation to the process accessing a single file. Reads are sequential, even if the kernel reads the 30 blocks at once, simultaneously. To read and scan several blocks from a single process, you actually have to do parallell processing at the application level, to split the job on several cores. This is not automatic, I know no language that does that.
If you have a 1MB stripe size, 5 spindles, now you can divide that up into 5 threads of 6MB searching each. You won't get a 5x speed up, but you'll likely get at least 2-3x. Besides, I doubt disk I/O is the limiting factor. Looking at your timings -- it's all spent in user space and is fairly constant for 3 runs -- indicating your datafile is likely already cached But at .7s, it's likely not worth it. Vs.:
Yes, it is probably cached.
time locate testing_manpage.log 11.10sec 11.00usr 0.06sys (99.72% cpu) Ishtar:law> time locate testing_manpage.log 11.00sec 10.97usr 0.03sys (100.00% cpu) locate /|wc -l 8574395
How many files are in your locate DB?
No idea how to find out. It is not a text file, line count doesn't tell it. The old locate database maybe. Telcontar:~ # l /var/lib/locatedb /var/lib/mlocate/mlocate.db - -rw-r--r-- 1 root root 27285793 Jun 12 00:16 /var/lib/locatedb - -rw-r----- 1 root locate 29122515 Jun 19 22:24 /var/lib/mlocate/mlocate.db Telcontar:~ # file /var/lib/locatedb /var/lib/mlocate/mlocate.db /var/lib/locatedb: GNU findutils locate database data, format 02 (frcode) /var/lib/mlocate/mlocate.db: data Telcontar:~ # Telcontar:~ # locate \* | wc -l 1293562 Telcontar:~ # cd - -- Cheers, Carlos E. R. (from 12.3 x86_64 "Dartmouth" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlHCxVQACgkQtTMYHG2NR9X+2gCcC0uiGOueA4265AqJ3+8yZkro yhgAn3P4unzSK1tyigIDKlWeR0Zda8b7 =2xnD -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org