我正在使用 tmux 在开发模式下运行 Rails 3.2.6。当我使用 tmux 滚动浏览 Rails 服务器的输出缓冲区(使用 rails s 运行)时,服务器冻结并且不处理任何请求。当我退出回滚模式时,服务器再次开始正常工作。
在查看输出缓冲区时,如何设置服务器以继续处理请求?
我正在使用 tmux 在开发模式下运行 Rails 3.2.6。当我使用 tmux 滚动浏览 Rails 服务器的输出缓冲区(使用 rails s 运行)时,服务器冻结并且不处理任何请求。当我退出回滚模式时,服务器再次开始正常工作。
在查看输出缓冲区时,如何设置服务器以继续处理请求?
If you want to pause and examine at some particular sequence of log messages while your server continues processing requests, it is probably best to directly view the log files instead; you might use less -R log/development.log
.
While a tmux pane is in “copy mode” (the mode used to view a pane’s history), tmux does not read any output from the processes running in the pane’s tty. If the processes continue to write output to the tty, then the OS’s tty buffer will eventually fill. When a program writes to a tty with a full buffer, it causes the process to block so that the buffer does not overflow; this is what causes your server to temporarily stop processing requests.
The timeline looks like this: