Re: fadvise/madvise during segment-merges....

2014-05-27 Thread Ravikumar Govindarajan
Sorry for the wrong info. I can only trace the code allocating twice the pages for SEQUENTIAL. I can't trace the code that discards the allocated pages... AFAIK, there are 2 options if discard doesn't happen automatically 1. SEQUENTIAL + NOREUSE This can be issued as a single-call, but I thin

Re: fadvise/madvise during segment-merges....

2014-05-21 Thread Michael McCandless
On Wed, May 21, 2014 at 10:50 AM, Ravikumar Govindarajan wrote: >> >> But does that mean SEQUENTIAL will evict the >> page once we're done reading it? > > > Yes, looks like it does evict the pages once read completes... That's great news, we need to re-test it. > Let me elaborate a bit more > >

Re: fadvise/madvise during segment-merges....

2014-05-21 Thread Ravikumar Govindarajan
> > But does that mean SEQUENTIAL will evict the > page once we're done reading it? Yes, looks like it does evict the pages once read completes... Well, that option is too late? Like, say I read in the N 1 GB files to merge, then I call DONTNEED once the merge is done, but by then the pages f

Re: fadvise/madvise during segment-merges....

2014-05-21 Thread Michael McCandless
On Wed, May 21, 2014 at 8:20 AM, Ravikumar Govindarajan wrote: > Great blog and lucid explanation > > I think things have changed in recent kernel versions. I am no expert, but > could see some code related to this here > http://lxr.free-electrons.com/source/mm/fadvise.c?v=3.14 That looks promisi

Re: fadvise/madvise during segment-merges....

2014-05-21 Thread Ravikumar Govindarajan
Great blog and lucid explanation I think things have changed in recent kernel versions. I am no expert, but could see some code related to this here http://lxr.free-electrons.com/source/mm/fadvise.c?v=3.14 O_DIRECT will be terrible drag no? Will a battery-backed disk cache help here? We are usin

Re: fadvise/madvise during segment-merges....

2014-05-21 Thread Michael McCandless
You're right, segment merges can be catastrophic to ongoing searches. I explored the problem here: http://blog.mikemccandless.com/2010/06/lucene-and-fadvisemadvise.html but a lot has changed since then... SEQUENTIAL is probably best (if the OS implements it; I think the Linux kernel has improved h

fadvise/madvise during segment-merges....

2014-05-21 Thread Ravikumar Govindarajan
Is it a good idea to use FADVISE_DONTNEED/MADVISE_DONTNEED flags during segment merge reads? Buffer-Cache contains critical data belonging to searches. A segment-merge has the potential to disturb the cache no? -- Ravi