V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  liuxu  ›  全部回复第 53 页 / 共 146 页
回复总数  2904
1 ... 49  50  51  52  53  54  55  56  57  58 ... 146  
2020-07-05 15:34:04 +08:00
回复了 yangyuhan12138 创建的主题 程序员 内核态用户态的数据拷贝,有点不明白
@louettagfh #10 https://man7.org/linux/man-pages/man2/mmap.2.html

mmap() creates a new mapping in the virtual address space of the calling process. The starting address for the new mapping is specified in addr. The length argument specifies the length of the mapping (which must be greater than 0). If addr is NULL, then the kernel chooses the (page-aligned) address at which to create the mapping; this is the most portable method of creating a new mapping. If addr is not NULL, then the kernel takes it as a hint about where to place the mapping; on Linux, the kernel will pick a nearby page boundary (but always above or equal to the value specified by /proc/sys/vm/mmap_min_addr) and attempt to create the mapping there. If another mapping already exists there, the kernel picks a new address that may or may not depend on the hint. The address of the new mapping is returned as the result of the call. The contents of a file mapping (as opposed to an anonymous mapping; see MAP_ANONYMOUS below), are initialized using length bytes starting at offset offset in the file (or other object) referred to by the file descriptor fd. offset must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). After the mmap() call has returned, the file descriptor, fd, can be closed immediately without invalidating the mapping.
2020-07-05 14:48:26 +08:00
回复了 zxc1234 创建的主题 问与答 请教几个问题
@zxc1234 找运营商买套餐,企业有企业专线,金融有额外独立专线
2020-07-05 14:43:12 +08:00
回复了 zxc1234 创建的主题 问与答 请教几个问题
1.不是,看指标
2.是,不过我们说的专线没你这么专
@huntrue 可把我给笑死了
2020-06-26 19:34:17 +08:00
回复了 maobukui 创建的主题 程序员 关于接私活价钱的问题,是个数据采集
把 2 年有期徒刑的钱也算上 /dog
2020-06-25 11:40:07 +08:00
回复了 caijiF 创建的主题 Linux lsattr 里边的 e 属性是什么意思
2020-06-25 11:32:52 +08:00
回复了 yangchuansheng33 创建的主题 Linux 跨云厂商部署 k3s 集群
好文,但是你博客这种扫码才能看的方式是真的恶心,现在好像还很流行这种方式
2020-06-23 08:29:07 +08:00
回复了 vlike 创建的主题 Linux 想买个小主机专门做编译工作,有推荐的吗?
@0312birdzhang #57 我赶紧点开淘宝
2020-06-22 00:06:10 +08:00
回复了 vlike 创建的主题 Linux 想买个小主机专门做编译工作,有推荐的吗?
@loveqianool GitHub Actions 正解
2020-06-20 12:26:40 +08:00
回复了 ali0531 创建的主题 程序员 有什么方法能远程获取短信验证码?
@maskerTUI emmm...google play 装的 v2rayNG 不算大公司吧,或者华为真开明,给了白名单,我华为 P30p,用着良好,或者是你开了省电模式?
2020-06-19 14:18:45 +08:00
回复了 ali0531 创建的主题 程序员 有什么方法能远程获取短信验证码?
@yukiloh 应用管理-应用启动管理,取消自动管理,手动管理里面选择允许后台活动

这样也不行?我的软件都是这么后台运行的
2020-06-15 13:20:30 +08:00
回复了 cnt2ex 创建的主题 Linux 用 docker 隔离不同用户
1 楼说的没错,virtualbox 也适合,有 headless
100k 交易事务,基本上前后端都得集群,瓶颈在数据库事务上,上数据库集群吧,任何交易一定要 100%准确,包括交易日志千万不能有丢失风险,能交易成功的就不要让他失败,加点钱加硬件,一笔交易硬件的钱稳稳的赚回来
2020-06-04 11:29:53 +08:00
回复了 xrr2016 创建的主题 程序员 想换个博客系统求建议
@solider245 直接用腾讯的备案,备案主体好像没有个人身份证限制,你在什么地方就能备什么地方,我湖北备案主体可以用全国的服务器,只需要在对应的服务商接入备案就可以了
2020-06-03 13:09:30 +08:00
回复了 xrr2016 创建的主题 程序员 想换个博客系统求建议
我已经从 github pages 迁移到腾讯上海服务器了,jekyll 本地编译上传
2020-05-29 13:02:08 +08:00
回复了 FONG2 创建的主题 数据库 单表近 7 亿条数据,现在要优化结构,进行去重,求个方案
@lscho 我最下面不是说了么,也可以清洗程序放自己的内存缓存,就是内存消耗有点大
2020-05-29 12:20:37 +08:00
回复了 FONG2 创建的主题 数据库 单表近 7 亿条数据,现在要优化结构,进行去重,求个方案
@FONG2 没想到这点,那这样

1.新建表 new_table,用户编号 user_id 为唯一索引
2. 从原表通过主键一次性顺序读 1 万-10 万行
3.利用程序语言的 set 数据结构清洗数据
4.清洗后的数据拼接成一条或者几条 insert 插入新表
先 select user_id from new_table where user_id not in (清洗后数据中的用户 user_id1,2,3,4...)
然后再 insert 批量插入

5.回到 2 循环执行到结束
6.在新表中给用户编号列创建唯一索引

那程序清洗时用 redis 的 set 数据结构缓存用户序列号,或者就用程序内部缓存,
看看 php 的 swoole,https://wiki.swoole.com/wiki/page/p-table.html,不过这种方案需要的内存很大
2020-05-29 11:43:35 +08:00
回复了 FONG2 创建的主题 数据库 单表近 7 亿条数据,现在要优化结构,进行去重,求个方案
@Lonersun 这个搞法岂不是得 7 亿个磁盘随机 io,要是是机械硬盘,一次 2-3 毫秒,假设 2 毫秒,700,000,000/86400/500=16 天。。

分析了一下,我建议这样:
1.新建个没有键的表(插入会更快)
2. 从原表通过主键一次性顺序读 1 万-10 万行
3.利用程序语言的 set 数据结构清洗数据
4.清晰后的数据拼接成一条或者几条 insert 插入新表
5.回到 2 循环执行到结束
6.在新表中给用户编号列创建唯一索引
1 ... 49  50  51  52  53  54  55  56  57  58 ... 146  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2672 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 39ms · UTC 03:13 · PVG 11:13 · LAX 20:13 · JFK 23:13
♥ Do have faith in what you're doing.