没有 lua 的 Redis 复制
Redis replication without lua
在描述问题之前,一些对问题很重要的信息。
Redis lua scripting replicates the script itself instead of
replicating the single commands, both to slaves and to the AOF file.
This is needed as often scripts are one or two order of magnitudes
faster than executing commands in a normal way, so for a slave to be
able to cope with the master replication link speed and number of
commands per second this is the only solution available.
More information about this decision in Lua scripting: determinism,
replication, AOF (github issue)).
问题
是否有任何方法或解决方法来复制单个命令而不是执行 LUA 脚本本身?
为什么?
我们使用 Redis 作为自然语言处理(多项式朴素贝叶斯)应用服务器。每次你想学习新文本时,你都应该更新单词权重的大列表。包含大约 1,000,000 个单词的单词表。使用 LUA 的处理时间为每 运行 ~350 毫秒。使用单独的应用程序服务器(基于 hiredis)的处理是每 运行 37 秒。
我考虑这样的解决方法:
- 计算完成后将密钥传输到其他(只读服务器)MIGRATE
- 不时将 RDB 保存并移动到其他服务器并由我自己加载。
是否还有其他解决方法可以解决此问题?
在描述问题之前,一些对问题很重要的信息。
Redis lua scripting replicates the script itself instead of replicating the single commands, both to slaves and to the AOF file. This is needed as often scripts are one or two order of magnitudes faster than executing commands in a normal way, so for a slave to be able to cope with the master replication link speed and number of commands per second this is the only solution available.
More information about this decision in Lua scripting: determinism, replication, AOF (github issue)).
问题
是否有任何方法或解决方法来复制单个命令而不是执行 LUA 脚本本身?
为什么?
我们使用 Redis 作为自然语言处理(多项式朴素贝叶斯)应用服务器。每次你想学习新文本时,你都应该更新单词权重的大列表。包含大约 1,000,000 个单词的单词表。使用 LUA 的处理时间为每 运行 ~350 毫秒。使用单独的应用程序服务器(基于 hiredis)的处理是每 运行 37 秒。
我考虑这样的解决方法:
- 计算完成后将密钥传输到其他(只读服务器)MIGRATE
- 不时将 RDB 保存并移动到其他服务器并由我自己加载。
是否还有其他解决方法可以解决此问题?