MySQL优化--IO调度算法优化
之前已经在微信公众号分享了数据库优化的方法,链接为https://mp.weixin.qq.com/s/6Atzk9UKPJRxxAs0nsKBXg 。 其中操作系统部分介绍了IO调度算法的优化,本文将通过压力测试的方式来对比不同的调度算法下磁盘IO的表现。
1 准备工作
1.1 安装sysbench
本次采用sysbench进行压测,先安装sysbench,步骤如下:
curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | sudo bash
yum -y install sysbench
sysbench --version
1.2 准备测试文件
生成后续需要使用的测试文件,block大小为16k(MySQL DBA都懂的,哈哈),创建4个文件,合计20G
[root@mha1 ~]# sysbench fileio --file-num= --file-block-size= --file-total-size=20G prepare
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) files, 5242880Kb each, 20480Mb total
Creating files for the test...
Extra file open flags: (none)
Creating file test_file.
Creating file test_file.
Creating file test_file.
Creating file test_file.
bytes written in 47.94 seconds (427.24 MiB/sec).
1.3 准备测试表
因为也要进行数据库读写方面的测试,因此需要先创建相关表及数据
[root@mha1 ~]# sysbench --db-driver=mysql --time= --threads= --report-interval= --mysql-host=127.0.0.1 --mysql-port= --mysql-user=root --mysql-password= --mysql-db=testdb --tables= --table_size= oltp_insert --db-ps-mode=disable prepare
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Initializing worker threads... Creating table 'sbtest3'...
Creating table 'sbtest2'...
Creating table 'sbtest5'...
Creating table 'sbtest6'...
Creating table 'sbtest8'...
Creating table 'sbtest7'...
Creating table 'sbtest4'...
Creating table 'sbtest1'...
Creating table 'sbtest10'...
Creating table 'sbtest9'...
Inserting records into 'sbtest4'
Inserting records into 'sbtest7'
Inserting records into 'sbtest5'
Inserting records into 'sbtest3'
Inserting records into 'sbtest1'
Inserting records into 'sbtest2'
Inserting records into 'sbtest8'
Inserting records into 'sbtest6'
Inserting records into 'sbtest10'
Inserting records into 'sbtest9'
Creating a secondary index on 'sbtest7'...
Creating a secondary index on 'sbtest10'...
Creating a secondary index on 'sbtest8'...
Creating a secondary index on 'sbtest5'...
Creating a secondary index on 'sbtest2'...
Creating a secondary index on 'sbtest9'...
Creating a secondary index on 'sbtest1'...
Creating table 'sbtest17'...
Creating a secondary index on 'sbtest3'...
Inserting records into 'sbtest17'
Creating a secondary index on 'sbtest4'...
Creating a secondary index on 'sbtest6'...
Creating table 'sbtest20'...
Inserting records into 'sbtest20'
Creating table 'sbtest18'...
Inserting records into 'sbtest18'
Creating table 'sbtest15'...
Inserting records into 'sbtest15'
Creating table 'sbtest19'...
Inserting records into 'sbtest19'
Creating table 'sbtest14'...
Inserting records into 'sbtest14'
Creating table 'sbtest11'...
Inserting records into 'sbtest11'
Creating table 'sbtest13'...
Creating table 'sbtest12'...
Inserting records into 'sbtest13'
Inserting records into 'sbtest12'
Creating table 'sbtest16'...
Inserting records into 'sbtest16'
Creating a secondary index on 'sbtest17'...
Creating a secondary index on 'sbtest20'...
Creating a secondary index on 'sbtest18'...
Creating a secondary index on 'sbtest19'...
Creating a secondary index on 'sbtest15'...
Creating a secondary index on 'sbtest11'...
Creating a secondary index on 'sbtest12'...
Creating a secondary index on 'sbtest13'...
Creating a secondary index on 'sbtest14'...
Creating a secondary index on 'sbtest16'...
2 查看支持的调度算法
本次磁盘为SSD硬盘,操作系统版本文Centos7.8 。下面将调度算法修改为三种不同的值来进行随机读与随机写的压力测试
本系统为Centos7.8,需要查看支持的IO调度算法,然后再进行修改测试。
[root@mha1 ~]# dmesg | grep -i scheduler
[ 4.885816] io scheduler noop registered
[ 4.885820] io scheduler deadline registered (default)
[ 4.885867] io scheduler cfq registered
[ 4.885870] io scheduler mq-deadline registered
[ 4.885872] io scheduler kyber registered
可见,再本系统中,默认的调度算法为 deadline。
也可以通过如下命令查看当前的调度算法,其中中括号里代表当前使用的调度算法。
[root@mha1 ~]# cat /sys/block/sda/queue/scheduler
noop [deadline] cfq
3 deadline算法
Deadline在机械盘的情况下对数据库环境(ORACLE RAC,MySQL等)是最好的选择。下面将进行随机写与随机读的压力测试
3.1 随机写
[root@mha1 ~]# sysbench fileio \
> --time= \
> --threads= \
> --file-total-size=20G \
> --file-test-mode=rndwr \
> --file-num= \
> --file-extra-flags=direct \
> --file-fsync-freq= \
> --file-block-size= \
> run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Running the test with following options:
Number of threads:
Initializing random number generator from current time Extra file open flags: directio
files, 5GiB each
20GiB total file size
Block size 16KiB
Number of IO requests:
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random write test
Initializing worker threads... Threads started! File operations:
reads/s: 0.00
writes/s: 6935.37
fsyncs/s: 0.53 Throughput:
read, MiB/s: 0.00
written, MiB/s: 108.37 General statistics:
total time: .0138s
total number of events: Latency (ms):
min: 0.10
avg: 3.46
max: 107.39
95th percentile: 14.73
sum: 4317610.93 Threads fairness:
events (avg/stddev): 52020.1667/426.95
execution time (avg/stddev): 179.9005/0.01
随机写的iops为6935.37,磁盘写入速度是108.37MiB/s
3.2 随机读
[root@mha1 ~]# sysbench fileio \
> --time= \
> --threads= \
> --file-total-size=20G \
> --file-test-mode=rndrd \
> --file-num= \
> --file-extra-flags=direct \
> --file-fsync-freq= \
> --file-block-size= \
> run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Running the test with following options:
Number of threads:
Initializing random number generator from current time Extra file open flags: directio
files, 5GiB each
20GiB total file size
Block size 16KiB
Number of IO requests:
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random read test
Initializing worker threads... Threads started! File operations:
reads/s: 7956.88
writes/s: 0.00
fsyncs/s: 0.00 Throughput:
read, MiB/s: 124.33
written, MiB/s: 0.00 General statistics:
total time: .0075s
total number of events: Latency (ms):
min: 0.10
avg: 3.01
max: 322.24
95th percentile: 5.47
sum: 4309094.67 Threads fairness:
events (avg/stddev): 59679.7083/2688.56
execution time (avg/stddev): 179.5456/0.18
随机读的iops为7956.88,磁盘读取速度是124.33MiB/s
3.3 测试数据库写
sysbench --db-driver=mysql --time= --threads= --report-interval= --mysql-host=127.0.0.1 --mysql-port= --mysql-user=root --mysql-password= --mysql-db=testdb --tables= --table_size= oltp_write_only --db-ps-mode=disable run SQL statistics:
queries performed:
read:
write:
other:
total:
transactions: (491.43 per sec.)
queries: (2948.62 per sec.)
ignored errors: (0.01 per sec.)
reconnects: (0.00 per sec.) General statistics:
total time: .1050s
total number of events: Latency (ms):
min: 2.58
avg: 16.27
max: 2608.34
95th percentile: 35.59
sum: 2399415.58 Threads fairness:
events (avg/stddev): 18435.3750/90.33
execution time (avg/stddev): 299.9269/0.04
可见,随机写入的TPS为491.43 ,查询次数为2948.62
3.4 测试数据库读
sysbench --db-driver=mysql --time= --threads= --report-interval= --mysql-host=127.0.0.1 --mysql-port= --mysql-user=root --mysql-password= --mysql-db=testdb --tables= --table_size= oltp_read_only --db-ps-mode=disable run SQL statistics:
queries performed:
read:
write:
other:
total:
transactions: (393.13 per sec.)
queries: (6290.13 per sec.)
ignored errors: (0.00 per sec.)
reconnects: (0.00 per sec.) General statistics:
total time: .0949s
total number of events: Latency (ms):
min: 3.08
avg: 20.34
max: 170.48
95th percentile: 29.19
sum: 2399636.31 Threads fairness:
events (avg/stddev): 14747.2500/1513.84
execution time (avg/stddev): 299.9545/0.04
可见,随机读时的TPS为393.13 ,查询次数为6290.13
4 noop算法
4.1 修改为noop算法
noop称为电梯调度算法,是基于FIFO队列实现的。所有的请求都是先进先出的,因为SSD的随机读、随机写速度快,因此该算法适合SSD硬盘。
[root@mha1 ~]# echo 'noop' >/sys/block/sda/queue/scheduler
[root@mha1 ~]# cat /sys/block/sda/queue/scheduler
[noop] deadline cfq
4.2 随机写
[root@mha1 ~]# sysbench fileio \
> --time= \
> --threads= \
> --file-total-size=20G \
> --file-test-mode=rndwr \
> --file-num= \
> --file-extra-flags=direct \
> --file-fsync-freq= \
> --file-block-size= \
> run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Running the test with following options:
Number of threads:
Initializing random number generator from current time Extra file open flags: directio
files, 5GiB each
20GiB total file size
Block size 16KiB
Number of IO requests:
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random write test
Initializing worker threads... Threads started! File operations:
reads/s: 0.00
writes/s: 7057.60
fsyncs/s: 0.53 Throughput:
read, MiB/s: 0.00
written, MiB/s: 110.27 General statistics:
total time: .0136s
total number of events: Latency (ms):
min: 0.10
avg: 3.40
max: 240.39
95th percentile: 14.46
sum: 4317435.99 Threads fairness:
events (avg/stddev): 52936.7083/487.57
execution time (avg/stddev): 179.8932/0.02
随机写的iops为7057.60,磁盘写入速度是110.27MiB/s
4.3 随机读
[root@mha1 ~]# sysbench fileio \
> --time= \
> --threads= \
> --file-total-size=20G \
> --file-test-mode=rndrd \
> --file-num= \
> --file-extra-flags=direct \
> --file-fsync-freq= \
> --file-block-size= \
> run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Running the test with following options:
Number of threads:
Initializing random number generator from current time Extra file open flags: directio
files, 5GiB each
20GiB total file size
Block size 16KiB
Number of IO requests:
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random read test
Initializing worker threads... Threads started! File operations:
reads/s: 8399.89
writes/s: 0.00
fsyncs/s: 0.00 Throughput:
read, MiB/s: 131.25
written, MiB/s: 0.00 General statistics:
total time: .0100s
total number of events: Latency (ms):
min: 0.10
avg: 2.85
max: 315.77
95th percentile: 5.00
sum: 4312384.33 Threads fairness:
events (avg/stddev): 63003.3750/10086.77
execution time (avg/stddev): 179.6827/0.12
随机读的iops为8399.89,磁盘读取速度是131.25MiB/s
4.4 数据库写入
sysbench --db-driver=mysql --time= --threads= --report-interval= --mysql-host=127.0.0.1 --mysql-port= --mysql-user=root --mysql-password= --mysql-db=testdb --tables= --table_size= oltp_write_only --db-ps-mode=disable run SQL statistics:
queries performed:
read:
write:
other:
total:
transactions: (544.38 per sec.)
queries: (3266.28 per sec.)
ignored errors: (0.01 per sec.)
reconnects: (0.00 per sec.) General statistics:
total time: .0903s
total number of events: Latency (ms):
min: 2.62
avg: 14.69
max: 220.12
95th percentile: 32.53
sum: 2399040.57 Threads fairness:
events (avg/stddev): 20420.5000/112.69
execution time (avg/stddev): 299.8801/0.04
可见,随机写入的TPS为 544.38 ,查询次数为3266.28
4.5 数据库只读
sysbench --db-driver=mysql --time= --threads= --report-interval= --mysql-host=127.0.0.1 --mysql-port= --mysql-user=root --mysql-password= --mysql-db=testdb --tables= --table_size= oltp_read_only --db-ps-mode=disable run
SQL statistics:
queries performed:
read:
write:
other:
total:
transactions: (379.97 per sec.)
queries: (6079.59 per sec.)
ignored errors: (0.00 per sec.)
reconnects: (0.00 per sec.) General statistics:
total time: .0869s
total number of events: Latency (ms):
min: 3.08
avg: 21.04
max: 321.03
95th percentile: 31.37
sum: 2399600.56 Threads fairness:
events (avg/stddev): 14253.2500/1475.71
execution time (avg/stddev): 299.9501/0.02
可见,只读时的TPS为 379.97,查询次数为6079.59
5 cfq算法
5.1 修改为cfq算法
cfq称为绝对公平调度算法,为每个进程及线程单独创建一个队列来管理IO请求,起到每个进程和线程均匀分布IO的效果。此算法适用于通用服务器,centos6中为默认的IO调度算法。
[root@mha1 ~]# echo 'cfq' >/sys/block/sda/queue/scheduler
[root@mha1 ~]# cat /sys/block/sda/queue/scheduler
noop deadline [cfq]
5.2 随机写
[root@mha1 ~]# sysbench fileio \
> --time= \
> --threads= \
> --file-total-size=20G \
> --file-test-mode=rndwr \
> --file-num= \
> --file-extra-flags=direct \
> --file-fsync-freq= \
> --file-block-size= \
> run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Running the test with following options:
Number of threads:
Initializing random number generator from current time Extra file open flags: directio
files, 5GiB each
20GiB total file size
Block size 16KiB
Number of IO requests:
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random write test
Initializing worker threads... Threads started! File operations:
reads/s: 0.00
writes/s: 6614.37
fsyncs/s: 0.53 Throughput:
read, MiB/s: 0.00
written, MiB/s: 103.35 General statistics:
total time: .0118s
total number of events: Latency (ms):
min: 0.10
avg: 3.63
max: 348.78
95th percentile: 15.27
sum: 4317092.54 Threads fairness:
events (avg/stddev): 49611.5417/517.80
execution time (avg/stddev): 179.8789/0.03
随机写的iops为6614.37,磁盘写入速度是103.35MiB/s
5.3 随机读
[root@mha1 ~]# sysbench fileio \
> --time= \
> --threads= \
> --file-total-size=20G \
> --file-test-mode=rndrd \
> --file-num= \
> --file-extra-flags=direct \
> --file-fsync-freq= \
> --file-block-size= \
> run
sysbench 1.0. (using bundled LuaJIT 2.1.-beta2) Running the test with following options:
Number of threads:
Initializing random number generator from current time Extra file open flags: directio
files, 5GiB each
20GiB total file size
Block size 16KiB
Number of IO requests:
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random read test
Initializing worker threads... Threads started! File operations:
reads/s: 7481.39
writes/s: 0.00
fsyncs/s: 0.00 Throughput:
read, MiB/s: 116.90
written, MiB/s: 0.00 General statistics:
total time: .0086s
total number of events: Latency (ms):
min: 0.10
avg: 3.20
max: 374.49
95th percentile: 5.77
sum: 4312382.07 Threads fairness:
events (avg/stddev): 56113.7917/3058.00
execution time (avg/stddev): 179.6826/0.17
随机读的iops为7481.39,磁盘读取速度是116.90MiB/s
5.4 数据库写
sysbench --db-driver=mysql --time= --threads= --report-interval= --mysql-host=127.0.0.1 --mysql-port= --mysql-user=root --mysql-password= --mysql-db=testdb --tables= --table_size= oltp_write_only --db-ps-mode=disable run
SQL statistics:
queries performed:
read:
write:
other:
total:
transactions: (498.54 per sec.)
queries: (2991.25 per sec.)
ignored errors: (0.01 per sec.)
reconnects: (0.00 per sec.) General statistics:
total time: .2552s
total number of events: Latency (ms):
min: 2.55
avg: 16.02
max: 779.62
95th percentile: 35.59
sum: 2397311.08 Threads fairness:
events (avg/stddev): 18711.3750/132.24
execution time (avg/stddev): 299.6639/0.38
可见,随机写入的TPS为498.54 ,查询次数为2991.25
5.5 数据库读
sysbench --db-driver=mysql --time= --threads= --report-interval= --mysql-host=127.0.0.1 --mysql-port= --mysql-user=root --mysql-password= --mysql-db=testdb --tables= --table_size= oltp_read_only --db-ps-mode=disable run
SQL statistics:
queries performed:
read:
write:
other:
total:
transactions: (344.66 per sec.)
queries: (5514.58 per sec.)
ignored errors: (0.00 per sec.)
reconnects: (0.00 per sec.) General statistics:
total time: .1562s
total number of events: Latency (ms):
min: 3.11
avg: 23.19
max: 222.31
95th percentile: 38.25
sum: 2399486.55 Threads fairness:
events (avg/stddev): 12931.6250/1278.72
execution time (avg/stddev): 299.9358/0.01
可见,只读时的TPS为 344.66,查询次数为5514.58
6 小结
根据测试结果对比一下三种调度算法的读写速度
| 算法 | IOPS | 磁盘写速度 | IOPS | 磁盘读速度 | oltp_write_only | oltp_read_only |
| deadline | 6935.37 | 118.37MiB/s | 7956.88 | 124.33MiB/s | TPS为491.43 ,查询次数为2948.62 | TPS为393.13 ,查询次数为6290.13 |
| noop | 7057.60 | 110.27MiB/s | 8399.89 | 131.25MiB/s | TPS为 544.38 ,查询次数为3266.28 | TPS为 379.97,查询次数为6079.59 |
| cfq | 6614.37 | 103.35MiB/s | 7481.39 | 116.90MiB/s | TPS为498.54 ,查询次数为2991.25 | TPS为 344.66,查询次数为5514.58 |
因为本次测试环境为SSD硬盘,因此,在此情况下建议选择noop磁盘IO调度算法,此结论也符合我们的预期。
特别注意:磁盘IO的调度算法还需要根据磁盘情况、数据库类型、数据库架构、业务场景(OLTP、OLAP等)等各种场景进行区分,不同的场景调度算法也要调整,不可一概而论。如果不确定的话,建议进行压测来判断,选择符合对应场景下最合适的算法。
想了解更多内容或参与技术交流可以关注微信公众号【数据库干货铺】或进技术交流群沟通。

MySQL优化--IO调度算法优化的更多相关文章
- MySQL数据库在IO性能优化方面的设置选择(硬件)
提起MySQL数据库在硬件方面的优化无非是CPU.内存和IO.下面我们着重梳理一下关于磁盘I/O方面的优化. 1.磁盘冗余阵列RAID RAID(Redundant Array of Inexpens ...
- 修改numa和io调度优化mysql性能
一.NUMA设置单机单实例,建议关闭NUMA,关闭的方法有三种:1.硬件层,在BIOS中设置关闭:2.OS内核,启动时设置numa=off:3.可以用numactl命令将内存分配策略修改为interl ...
- MySQL服务器 IO 100%的分析与优化方案
前言 压力测试过程中,如果因为资源使用瓶颈等问题引发最直接性能问题是业务交易响应时间偏大,TPS逐渐降低等.而问题定位分析通常情况下,最优先排查的是监控服务器资源利用率,例如先用TOP 或者nmon等 ...
- 美图秀秀DBA谈MySQL运维及优化
美图秀秀DBA谈MySQL运维及优化 https://mp.weixin.qq.com/s?__biz=MzI4NTA1MDEwNg==&mid=401797597&idx=2& ...
- 性能调优之MySQL篇四:MySQL配置定位以及优化
一.CPU最大性能模式 cpu利用特点 5.1 最高可用4个核 5.5 最高可用24核 5.6 最高可用64核心 一次query对应一个逻辑CPU 你仔细检查的话,有些服务器上会有的一个有趣的现象:你 ...
- [MySQL Reference Manual] 8 优化
8.优化 8.优化 8.1 优化概述 8.2 优化SQL语句 8.2.1 优化SELECT语句 8.2.1.1 SELECT语句的速度 8.2.1.2 WHERE子句优化 8.2.1.3 Range优 ...
- MySql学习(六) —— 数据库优化理论(二) —— 查询优化技术
逻辑查询优化包括的技术 1)子查询优化 2)视图重写 3)等价谓词重写 4)条件简化 5)外连接消除 6)嵌套连接消除 7)连接消除 8)语义优化 9)非SPJ优化 一.子查询优化 1. ...
- MySql学习(五) —— 数据库优化理论篇(一)
一.数据库管理系统 数据库管理系统(Database Management System, DBMS) 衡量是否是数据库的标准: ACID:是指在数据库管理系统(DBMS)中事务所具有的四个特性: 1 ...
- mysql内存使用以及优化中需要的几点注意
1.从内存中读取数据是微秒级别的.而从磁盘读则是毫秒级别的.二者相差一个数量级.所以想优化数据库,第一个要做到的就是优化io. 2.key_buffer_size[global]设置的内存区域大小缓存 ...
随机推荐
- gc 模块常用函数
""" 1.gc.set_debug(flags) 设置gc的debug日志,一般设置为gc.DEBUG_LEAK 2.gc.collect([generation]) ...
- 4.28 省选模拟赛模拟赛 最佳农场 二维卷积 NTT
第一次遇到二维卷积 不太清楚是怎么做的. 40分暴力比对即可. 对于行为或者列为1时 容易想到NTT做快速匹配.然后找答案即可. 考虑这是一个二维的比对过程. 设\(f_{i,j}\)表示以i,j为右 ...
- IDEA查看项目日志Version Control、log
打开IDEA找到以下两处: 右下角git 黄色指针指向当前项目的版本 选中初始化项目,点击右键选择"Checkout Revision 1db2f3d5",如下图 ...
- Django自学教程PDF高清电子书百度云网盘免费领取
点击获取提取码:x3di 你一定可以学会,Django 很简单! <Django自学教程>的作者学习了全部的 Django英文的官方文档,觉得国内比较好的Django学习资源不多,所以决定 ...
- 不要再问我MVC、MVP、MVVM了
网络上有很多类似的讨论.包括一些大v,比如 阮一峰:MVC,MVP 和 MVVM 的图示 廖雪峰:MVVM 司徒正美: 各自用一句话来概括MVC.MVP.MVVM的差异特点 ... 但是说的往往比较概 ...
- 【小白学AI】线性回归与逻辑回归(似然参数估计)
文章转自[机器学习炼丹术] 线性回归解决的是回归问题,逻辑回归相当于是线性回归的基础上,来解决分类问题. 1 公式 线性回归(Linear Regression)是什么相比不用多说了.格式是这个样子的 ...
- 吴太银:华为消费者云服务Cassandra使用场景与最佳实践
大家好,我是华为消费者云的吴太银. 我今天分享的主要是华为消费者云服务使用Cassandra的应用场景和最佳实践.我这个可能跟其他嘉宾分享的不太一样,因为前几个嘉宾讲的实际上对Cassandra原生的 ...
- 阿里ECS云服务器部署文件
今天,接触了阿里ECS云服务器,免费领取链接https://dwz.cn/WOFZpZz1 获取之后,要添加一下端口,刚开始需要80 8080 3306的端口,其他的根据需要自行添加 点击快速创建 ...
- SQL Server中的集合运算: UNION, EXCEPT和INTERSECT
SQL Server中的集合运算包括UNION(合并),EXCEPT(差集)和INTERSECT(相交)三种. 集合运算的基本使用 1.UNION(合并两个查询结果集,隐式DINSTINCT,删除重复 ...
- .NET Core Web APi大文件分片上传研究
前言 前两天发表利用FormData进行文件上传,然后有人问要是大文件几个G上传怎么搞,常见的不就是分片再搞下断点续传,动动手差不多也能搞出来,只不过要深入的话,考虑的东西还是很多.由于断点续传之前写 ...