node.js通过inode打开nfs文件(或重新打开文件的最快方法) [英] nodejs open nfs files by inode (or a the fastest way to reopen a file)

查看:257
本文介绍了node.js通过inode打开nfs文件(或重新打开文件的最快方法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在编写一个缓存系统,该系统将在磁盘和内存中保存序列化(json)数据,以减少数据库的I/O负载.

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.

系统将通过在内存中保存最近访问的X个文件并从磁盘读取其他文件来工作.

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

我已经读到,有一些系统可以通过inode打开文件来减少nfs(我将来可能会用到)系统上的I/O负载.

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.

我的问题是:

  1. 是否可以通过nodejs中的inode在nfs文件系统上打开文件?如果没有,我需要做些什么功课才能实现它?
    2.绝对不可能通过inode在本地文件系统上打开文件吗?
    3.如果实际上不可能,是否有更快的方法来重新打开文件,因为让操作系统一次又一次地统计文件似乎不必要地重复?
  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. 否,没有用户可通过inode打开文件的方法,因为这样做在某些情况下将允许用户绕过文件系统ACL.

  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.

是的.相同的原因.

最有能力的NFS客户端(包括Linux内核)将在本地缓存统计结果.

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

这篇关于node.js通过inode打开nfs文件(或重新打开文件的最快方法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆