可视化学习 Go 并发编程简单来说,并发是一种构造程序的方式 Concurrency is not Parallelism Slide (http://talks.golang.org/2012/waza.slide) 1. 并发很强大 2. 并发帮助实现并行,使并行(扩展等)变得容易 3. 并发不是并行,并发重点是架构,并行重点是执行,两者不同,但相关。 04:22 / 31:21 可视化 并发(Concurrency) & 并行(Parallelism) 并行(Parallelism) 一图胜千言! 并行(PARALLELISM) 这是并行 (/2017/go-concurrency-visualize/parallelism.html) 并发(CONCURRENCY) 这是并发 (/2017/go-concurrency-visualize/pingpong36.html) 为什么要关注并发?当今是多核的时代,并发的世界 多核的时代 并发编程并不容易,但 // 发送 42 给 channel ch <- 42 }() // 从 channel 读取 <-ch } Go并发可视化 (/2017/go-concurrency-visualize/helloworld.html) 2. 计时器 func tick(d time.Duration) <-chan int { c := make(chan0 码力 | 29 页 | 1.48 MB | 1 年前3
03. Go语言最差实践 - 李俱顺SETTING TIMEOUT Go Concurrency Patterns: Context https://blog.golang.org/context #3 OVERREACHING FOR CONCURRENCY OVERREACHING FOR CONCURRENCY https://github.com/system-pclub/go-concurrency-bugs OVERREACHING FOR CONCURRENCY Concurrency is Hard. • CSP does not change that. https://medium.com/oreillymedia/why-concurrency-is-hard-f93104cad54b OVERREACHING FOR CONCURRENCY OVERREACHING FOR CONCURRENCY OVERREACHING OVERREACHING FOR CONCURRENCY Single thread is still powerful & relaxed. OVERREACHING FOR CONCURRENCY https://www.usenix.org/system/files/conference/hotos15/hotos15-paper-mcsherry.pdf Scalability! But0 码力 | 38 页 | 3.27 MB | 1 年前3
TiDB v5.2 中文手册allow-concurrent-memtable-write: true server.grpc-concurrency: 6 readpool.unified.min-thread-count: 5 readpool.unified.max-thread-count: 20 readpool.storage.normal-concurrency: 10 pessimistic-txn.pipelined: true enable-request-batch: false TiDB 全局变量配置 set global tidb_hashagg_final_concurrency=1; set global tidb_hashagg_partial_concurrency=1; set global tidb_enable_async_commit = 1; 41 set global tidb_enable_1pc readpool.storage.normal-concurrency: 10 readpool.unified.max-thread-count: 20 readpool.unified.min-thread-count: 5 rocksdb.max-background-jobs: 8 server.grpc-concurrency: 6 storage.scheduler-worker-pool-size:0 码力 | 2259 页 | 48.16 MB | 1 年前3
TiDB中文技术文档true 在做 join 的时候,两边表没有任何条件(where 字段),默认可以执行这样的语句。但是设置为 false, 则如有这样的 join 语句出现,server 会拒绝执行 join-concurrency 并发执行 join 的 goroutine 数量 默认: 5 看数据量和数据分布情况,一般情况下是越多越好,数值越大对 CPU 开销越大 日志中记录最大 sql 语句长度 默认: 2048 sql 语句将被记录 默认: 300 值只能是一个整数 (int) ,单位是毫秒 port path socket binlog-socket run-ddl cross-join join-concurrency query-log-max-len slow-threshold int slow-query-file TiDB 进程启动参数 - 29 - 本文档使用 书栈(BookStack.CN) 的基础上,定义了一些专用的系统变量和语法用来优化性能。 变量可以通过 SET 语句设置,例如 set @@tidb_distsql_scan_concurrency = 10 如果需要设值全局变量,执行 set @@global.tidb_distsql_scan_concurrency = 10 作用域: SESSION 默认值: 空字符串 这个变量用来设置当前会话期待读取的历史数据所处时刻。 比如当设置为0 码力 | 444 页 | 4.89 MB | 6 月前3
TiDB v5.1 中文手册enable-sem 新增 控制是否启用 安全增强模式 (SEM)。默认值 为 false,代表 未启用。 TiDB 配置文件 performance. �→ committer- �→ concurrency �→ 修改 在单个事务的 提交阶段,控 制用于执行提 交操作相关请 求的并发数。 默认值从 16 修 改为 128。 TiDB 配置文件 performance. �→ tcp-no- scan- �→ threads 新增 控制增量扫描 历史数据任务 的线程个数。 默认值为 4,代 表 4 个线程。 TiKV 配置文件 incremental- �→ scan- �→ concurrency �→ 新增 控制增量扫描 历史数据任务 的最大并发执 行个数。默认 值为 6,代表最 多并发执行 6 个任务。 27 配置文件 配置项 修改类型 描述 TiKV 配置文件 soft-pending- allow-concurrent-memtable-write: true server.grpc-concurrency: 6 readpool.unified.min-thread-count: 5 readpool.unified.max-thread-count: 20 readpool.storage.normal-concurrency: 10 pessimistic-txn.pipelined: true0 码力 | 2189 页 | 47.96 MB | 1 年前3
TiDB v5.3 中文手册allow-concurrent-memtable-write: true server.grpc-concurrency: 6 readpool.unified.min-thread-count: 5 readpool.unified.max-thread-count: 20 readpool.storage.normal-concurrency: 10 pessimistic-txn.pipelined: true true TiDB 全局变量配置 set global tidb_hashagg_final_concurrency=1; set global tidb_hashagg_partial_concurrency=1; set global tidb_enable_async_commit = 1; set global tidb_enable_1pc = 1; set global tidb readpool.storage.normal-concurrency: 10 readpool.unified.max-thread-count: 20 readpool.unified.min-thread-count: 5 rocksdb.max-background-jobs: 8 server.grpc-concurrency: 6 storage.scheduler-worker-pool-size:0 码力 | 2374 页 | 49.52 MB | 1 年前3
TiDB v8.5 中文手册com/zh/tidb/v8.4/system-variables#tidb_auto_analyze_concurrency �→ -从-v840-版本开始引入">自动统计信息收集任务支持并发使用系统变量 tidb_auto_analyze_concurrency�→ 控制单个自动统计信息收集任务内部的并发度,TiDB �→ 会根据节点规模和 从 v8.4.0 开始, 该变量 被废弃。 其值将 固定为 默认值 ON,即 默认启 用分区 表。 tidb_ �→ analyze �→ _ �→ partition �→ _ �→ concurrency �→ 修改 取值范 围从 [1, �→ 18446744073709551615] �→ 修改 为 [1, �→ 128]。 48 变量名 修改类型 描述 tidb_ �→ enable 512 MiB), 表示默 认开启 该功能, 且最小 值允许 设置为 67108864 �→ (即 64 MiB)。 tidb_auto �→ _ �→ analyze �→ _ �→ concurrency �→ 新增 设置单 个自动 统计信 息收集 任务内 部的并 发度。在 v8.4.0 之 前,该 并发度 固定为 1。你可 以根据 集群资 源情况 提高该 并发度, 从而加 快统计 信息收0 码力 | 5095 页 | 104.54 MB | 10 月前3
TiDB v7.1 中文手册region-split-batch-size 用于控制批量 split Region 时的 Region 个数,默认值为 4096。 – tikv-importer.region-split-concurrency 用于控制 Split Region 时的并发度,默认值为 CPU 核心数。 – tikv-importer.region-check-backoff-limit 用于控制 split 和 的最大 Region 数 量,默认 值为 4096。 TiDB Lightning tikv- �→ importer �→ . �→ region �→ -split �→ - �→ concurrency �→ 新增 用于控制 Split Region 时的并发 度,默认 值为 CPU 核心数。 TiCDC insecure- �→ skip- �→ verify 新增 用于控制 在同步数 +----------+------+ �→ | Projection_4 | 299821.99 | 24 | root | | time:60.8ms, �→ loops:6, Concurrency:5 �→ �→ | hour(cast(bookshop.ratings.rated_at, time))->Column#6, Column#5 �→ | 17.7 KB �→ | N/A0 码力 | 4369 页 | 98.92 MB | 1 年前3
TiDB v8.1 中文手册重启,日志备份的 global checkpoint 推进提前于实际备份文件写入点,可能导致少量 备份数据丢失的问题 #16809 @YuJuncen * 修复全量备份时日志中出现无效的 --concurrency 相关信息的问题 #50837 @BornChanger * 修复在 BR 恢复数据或 TiDB Lightning 物理导入模式下导入数据时,从 PD 获取到的 Region 没有 Leader +----------+------+ �→ | Projection_4 | 299821.99 | 24 | root | | time:60.8ms, �→ loops:6, Concurrency:5 �→ �→ | hour(cast(bookshop.ratings.rated_at, time))->Column#6, Column#5 �→ | 17.7 KB �→ | N/A 660079ms, concurrency:5, task_num:293, tot_wait �→ :262.536669ms, tot_exec:40.171833ms, tot_time:302.827753ms, max:60.636886ms, p95 �→ :60.636886ms}, final_worker:{wall_time:60.701437ms, concurrency:5, task_num:250 码力 | 4807 页 | 101.31 MB | 1 年前3
TiDB v8.0 中文手册命令行工具新增的恢复参数 --load-stats 控制是否恢复统计信息 #50568 @Leavrth * 支持通过 br 命令行工具新增的恢复参数 --tikv-max-restore-concurrency 控制每个 TiKV 节点 的最大 download 和 ingest 文件数量,并通过控制作业队列的最大长度,进而控制 BR 节点的内 存消耗 #51621 @3pointer * 粗粒度打散 +----------+------+ �→ | Projection_4 | 299821.99 | 24 | root | | time:60.8ms, �→ loops:6, Concurrency:5 �→ �→ | hour(cast(bookshop.ratings.rated_at, time))->Column#6, Column#5 �→ | 17.7 KB �→ | N/A 660079ms, concurrency:5, task_num:293, tot_wait �→ :262.536669ms, tot_exec:40.171833ms, tot_time:302.827753ms, max:60.636886ms, p95 �→ :60.636886ms}, final_worker:{wall_time:60.701437ms, concurrency:5, task_num:250 码力 | 4805 页 | 101.28 MB | 1 年前3共 198 条- 1
- 2
- 3
- 4
- 5
- 6
- 20













