Monotonic time stepped backwards!
看起来是系统时钟有问题,请尝试检查并正确设置系统时间及硬件时间,可以参考如下命令
man7-timedatactl
man8-hwclock
EMQX 是在虚拟机里面么。有一个很早之前的虚拟机的 bug 可能有关。
I’m running Elixir/Phoenix in a VirtualBox instance. After a short period of time (typically 5 minutes or so), Elixir quits with this output: Monotonic time stepped backwards! Previous time: 2140883699436 Current time: 2140883692221 [os_mon] cpu...
Reading time: 1 mins 🕑
Likes: 10 ❤
https://www.virtualbox.org/ticket/7915
确实是在VirtualBox 7中的运行,可是这个有关时钟问题VirtualBox十几年前就解决了,真是头大。可以关闭erlang关于这个的监测吗
在相同环境下,直接采用EMQX5.0.25 开源版的安装包安装,通过service emqx start启动后一切正常。所以应该不是VirtualBox的问题
你编译用的 otp 是哪个版本。
“安装包安装” 是哪个版本,有具体链接么,也有可能是 otp 版本的问题。
编译的otp版本:Erlang/OTP 25 [erts-13.0.4]
安装包是使用 通过 Apt 源安装,curl -s https://assets.emqx.com/scripts/install-emqx-deb.sh | sudo bash
sudo apt-get install emqx
sudo service start emqx
先使用下 OTP24 编译尝试下呢
这可能是 OTP25 虚拟机的一个时间偏移相关参数导致的
opened 11:32PM - 13 Jun 21 UTC
closed 04:25PM - 08 Jun 22 UTC
team:VM
enhancement
**Is your feature request related to a problem? Please describe.**
The recomm… endation for per the docs is to use multi time warp mode in general, but it not the default. The current default is `no_time_warp` yet is only the default for backwards compatibility with ERTS versions prior to 7.0.
**Describe the solution you'd like**
Switch to `multi_time_warp` mode `+C multi_time_warp` by default.
**Describe alternatives you've considered**
- Warn the user that they are not in multi time warp mode
- Might send a good signal to users to educate themselves on time correction, but could be very confusing (mixed signal) and annoying.
**Additional context**
I think this change should happen in OTP 25. This would give others plenty of time to prepare for the change. I'm happy to do the PR for this one, but figured the OTP teams needs to discuss and decide if the time is right for this switch.
erlang:master
← rickard-green:rickard/default-muli-timewarp-mode/GH-4965/OTP-18135
opened 12:54PM - 03 Jun 22 UTC
As announced when OTP 25 was released, multi time warp mode is now enabled by de… fault. This assumes that all code executing on the system is time warp safe.
If you have old code in the system that is not time warp safe, you now explicitly need to start the system in no time warp mode (or singe time warp mode if it is partially time warp safe) in order to avoid problems. When starting the system in no time warp mode, the system behaves as it did prior to the introduction of the extended time functionality introduced in OTP 18.
If you have code that is not time warp safe, you are strongly encouraged to change this so that you can use multi time warp mode. Compared to no time warp mode, multi time warp mode improves scalability and performance as well as accuracy and precision of time measurements.
Closes #4965
stone
2023 年5 月 22 日 10:23
11
EMQX 5.0.26 或者 5.1.0 中修复,修复前可以在 vm.args 中增加
+C multi_time_warp
2 个赞
@JimMoen 您好,我最近也碰到了这个问题,但是没法复现出来。我在搜索解决方法的时候发现了这个帖子 ,这个帖子的发表时间很新,而且它里面提到了+C multi_time_warp这个选项并不管用。请问您能帮忙解惑一下吗?谢谢!
BTW,“Monotonic time stepped backwards”这个报错信息是在 OTP25 才加进去的,24 里根本没有。https://github.com/erlang/otp/commit/debc4438d4a608710b19ad867895507442f98576