You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Joe Shaw <jo...@novell.com> on 2006/12/21 19:34:38 UTC
Re: First search is slow after updating index .. subsequent
searches very fast
Hi,
On Thu, 2006-12-21 at 10:21 -0800, Otis Gospodnetic wrote:
> Something like dd if=/path/to/index/foo.cfs of=/dev/null
> Basically, force the data through the kernel preemptively, so FS caches it.
> Run vmstat while doing it, and if the index hasn't been cached by the FS,
> you should see a spike in IO activity while dd is running.
You might be able to do this more efficiently with the posix_fadvise()
function. C pseudocode:
int fd = open ("/path/to/index/foo.cfs");
// indicate you'll be reading the file sequentially
posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
// tell the kernel you will need the whole file.
posix_fadvice (fd, 0, 0, POSIX_FADV_WILLNEED);
I don't know offhand if Java binds these APIs, though.
Joe
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org