Keep a file in memory an any cost

Alain Spineux aspineux at gmail.com
Wed May 11 20:23:24 UTC 2011


Joe: The index is modified very often and need to be flushed at
regular interval, I don't want to handle read and write.
JB: I already use mmap.
JD: I already tried posix_fadvise with POSIX_FADV_WILLNEED, but this
is not rock solid, if not used for a long time, data are not in the
cache anymore.
Bryn: mlock is what I was looking for. I'll make a try now.

Thanks to the community.

On Wed, May 11, 2011 at 8:19 PM, Alain Spineux <aspineux at gmail.com> wrote:
> Hello I have a file, that is an index, it is open all the time by the
> application,
> but sometime the access are slow because the file was moved out of the cache.
>
> How can I keep it in memory all the time ?
> I can read it at regular interval, but this is a little over kill ?
>
> Any idea
>
> thanks.
>
>
> --
> Alain Spineux                   |  aspineux gmail com
> Monitor your iT & Backups |  http://www.magikmon.com
> Free Backup front-end       | http://www.magikmon.com/mksbackup
> Your email 100% available |  http://www.emailgency.com
>



-- 
Alain Spineux                   |  aspineux gmail com
Monitor your iT & Backups |  http://www.magikmon.com
Free Backup front-end       | http://www.magikmon.com/mksbackup
Your email 100% available |  http://www.emailgency.com


More information about the users mailing list