V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  keakon  ›  全部回复第 6 页 / 共 52 页
回复总数  1033
1 ... 2  3  4  5  6  7  8  9  10  11 ... 52  
2021-02-26 16:16:45 +08:00
回复了 firethehole 创建的主题 Redis scan 0 COUNT 1 为啥会查询出两条数据呢?
原因是这个
https://redis.io/commands/scan#why-scan-may-return-all-the-items-of-an-aggregate-data-type-in-a-single-call

只有当底层实现是 hash table 的时候,cursor 才有意义。出于内存优化的考虑,较小的数据结构(比如只有 2 个 key ),redis 会用 compact single-allocation packed encoding 。这种编码下强行使用 cursor 会导致时间复杂度变成 O(n),所以会直接返回所有数据。
2021-02-06 17:21:11 +08:00
回复了 Te11UA 创建的主题 Redis 大量 sunionstore 怎么提高性能?
不知道你的业务场景是怎样的,我弄了 1 万个 set,每个 set 1000 个整数,sunionstore 1 万次不同的 set 也就 200 多 ms 。但是因为修改比较多,会触发 bgsave,可以关闭掉在 slave 去做。

如果这也是瓶颈的话,在应用层读出来合并再写回去会慢一个数量级。
不过如果不需要保存 sunionstore 的结果,这样虽然慢,但是可以节省 redis 的 CPU 。
2021-01-22 16:49:20 +08:00
回复了 scoutteemo 创建的主题 Python 寻求 Python 代码管控方案
这样管控,多个人怎么并行开发?
2021-01-13 10:48:50 +08:00
回复了 szxczyc 创建的主题 Python 面试还是不写或者少写博客
Python 没有 i++ 啊
2020-04-22 11:25:11 +08:00
回复了 OnlyO 创建的主题 Python supervisor 和 mysql 开机启动问题
把 supervisor 改成在 mysql 后启动
离线安装有 pip 就行
用 virtualenv
因为很多库的新版本可以直接 apt 安装,不用自己编译
2020-01-02 23:51:15 +08:00
回复了 aFlappyPig 创建的主题 Python Python 脚本在 windows 上怎么长期运行?
捕捉或忽略 SIGHUP 就行了吧
2019-12-15 22:36:15 +08:00
回复了 1oNflow 创建的主题 Java Redis 定期删除过期键的频率如何设定最优?
不可量化。这是一个静态的配置,你存储的带过期时间的数据是动态变化的,这相当于用一个一元方程拟合随机序列。
2019-12-10 16:48:09 +08:00
回复了 chenshun00 创建的主题 Python Python shell 交互返回结果被截断
-w Wide output. Use this option twice for unlimited width.

If ps can not determine display width, as when output is redirected (piped) into a file or another command, the output width is undefined (it may be 80, unlimited, determined by the TERM variable, and so on). The COLUMNS environment variable or --cols option may be used to exactly determine the width in this case. The w or -w option may be also be used to adjust width.
2019-12-10 16:26:52 +08:00
回复了 chenshun00 创建的主题 Python Python shell 交互返回结果被截断
改成 ps -efww
2019-11-29 14:26:59 +08:00
回复了 1419co1in 创建的主题 Python Python 代码的加密问题
我是用 cython 编译所有模块,main.py 里只 import 和调用 run()。
2019-11-26 15:22:52 +08:00
回复了 18870715400 创建的主题 Python # 关于 Python 中的 threadpool
第三方的库就别想着用它接口以外的东西了
2019-09-09 09:56:54 +08:00
回复了 kayseen 创建的主题 Python 室内温度监控的 mysql 数据库设计
clickhouse
2019-08-30 18:44:06 +08:00
回复了 likefly 创建的主题 数据库 公司用多列做主键,但是我觉得没必要
@livid 标签多识别了一个引号
2019-08-09 09:40:29 +08:00
回复了 snal123 创建的主题 Redis redis-lua 访问缓慢的问题
我这返回 5 毫秒。
2019-07-31 14:01:52 +08:00
回复了 w9ay 创建的主题 Python [ Python ] 为什么 requests hook 失败了
一个是在 import model 之前修改,另一个是修改 model.requote_uri
2019-07-30 18:49:31 +08:00
回复了 w9ay 创建的主题 Python [ Python ] 为什么 requests hook 失败了
models.py 里执行了 from .utils import requote_uri,你再去修改 requests.utils.requote_uri,不会对 models.py 里的 requote_uri 有任何影响。
2019-07-29 16:04:27 +08:00
回复了 linxy19957 创建的主题 Python Python 有什么简单办法将字典换到磁盘里操作吗
直接把原始的字典文件压缩后传过去啊,不然另一台机器加载这个字典就内存溢出了。
1 ... 2  3  4  5  6  7  8  9  10  11 ... 52  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1111 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 46ms · UTC 19:24 · PVG 03:24 · LAX 12:24 · JFK 15:24
Developed with CodeLauncher
♥ Do have faith in what you're doing.