nodejs open nfs files by inode (or a the fastest way to reopen a file)

 ̄綄美尐妖づ 提交于 2019-12-12 04:04:58

问题


I am currently writing a caching system that will hold serialized (json) data on disk and in memory in order to reduce I/O load on a database.

The system will work by holding the last X number of accessed files in memory and read other files from disk.

I have read that there are systems out there that reduce I/O load on nfs (which I may use in the future) systems by opening files by inode.

My questions are:

  1. Is there a way to open files on a nfs file system by inode in nodejs? If not, what homework would I need to do to make it happen?
    2. Is it absolutely impossible to open a file on a local file system by inode?
    3. if it is in fact impossible is there a faster way to reopen a file as it seems unnecessarily repetitive to have the OS stat the file over and over?

回答1:


  1. No, there is no user-accessible way to open files by inode, because doing so would, in some cases, allow users to bypass filesystem ACLs.

  2. Yes. Same reason.

  3. Most competent NFS clients, including the Linux kernel, will cache stat results locally.



来源:https://stackoverflow.com/questions/10301442/nodejs-open-nfs-files-by-inode-or-a-the-fastest-way-to-reopen-a-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!