/dev/null 在 Web 服务器中的意义?
最近我听说了一些关于 Mongrel2 中 /dev/null 的实现(或者更确切地说,使用)以及其他项目的信息。但是,我从未见过它解释这实际上意味着什么。
这意味着什么,为什么它有利于可扩展性(正如我所看到的那样)?
Recently I've heard a bit about the implementation (or rather, use of) /dev/null in Mongrel2, as well as other projects. However, I've never seen it explained what this actually means.
What does this mean, and why is it good for scalability (as I've seen it be claimed)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请阅读此 :-) Mongrel2“支持”是一个笑话(请参阅更改,后来是已删除)。
不过,严肃地说,当您想要丢弃进程的输出时,
/dev/null
很有用。例如,您可以将输出重定向到它,内核将丢弃该输出。Please read this :-) The Mongrel2 "support" was a joke (see the change, which was later removed).
Being serious though,
/dev/null
is useful when you want to discard output from processes. You can redirect output to it, for example, and the kernel will just discard that output./dev/null 是 UNIX 系统上的虚拟设备,它基本上会删除发送给它的所有数据。
/dev/null is a virtual device on UNIX systems which basically drops all data sent to it.