MYSQLinsert速度过慢
MYSQLinsert速度过慢最近在用MySQL做存储,测试中发现插入数据太慢了,插入速度只有20
MY SQL insert 速度过慢
最近在用MySQL做存储,测试中发现插入数据太慢了,插入速度只有20-30 条/秒,后来查资料后,将MySQL的1个参数:innodb_flush_log_at_trx_commit,1改为了0(修改方法,可以直接修改my.ini(windows)/my.cnf(linux)中的对应参数,似乎用命令直接设置没有效果),插入速度就提升到了3000+每S,MySQL的文档中,对这个参数的描述如下:
If the value of innodb_flush_log_at_trx_commit is 0, the log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but nothing is done at a transaction commit. When the value is 1 (the default), the log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file. When the value is 2, the log buffer is written out to the file at each commit, but the flush to disk operation is not performed on it. However, the flushing on the log file takes place once per second also when the value is 2. Note that the once-per-second flushing is not 100% guaranteed to happen every second, due to process scheduling issues.
这样,如果transaction commit的频率非常高,1秒钟内会进行很多次的话,可以考虑将其设置为0,但这样就要承担数据库Crash后,1秒内未存储到数据库数据丢失可能的风险
MYSQLinsert速度过慢的更多相关文章
- “通过jumpserver远程登录linux服务器,rz上传文件速度过慢”问题的解决
问题: windows通过jumpserver远程登录到linux服务器,使用rz上传jar包,速度太慢(10k以内). 解决方案: 思路:通过ssh直接登录远程服务器 1.secureCRT-> ...
- docker - apt-get更换国内源解决Dockerfile构建速度过慢
背景 使用ubuntu镜像一般apt-get源地址都是在国外导致在构建时因为源地址问题导致下载速度极其得慢 在构建中应事先修改apt-get源地址来避免因下载速度过慢导致的构建缓慢问题 方案 在Doc ...
- sqlite3的图片的(二进制数据)存取操作
sqlite3的图片的(二进制数据)存取操作 前言 上篇介绍了sqlite3的一些常用插入操作方法和注意事项,在实际项目中遇到了图片缓存的问题,由于服务器不是很稳定,且受到外界环境的干扰(例如断电 ...
- Guest Speaker on 2015 WinHEC Shenzhen 秋季大会
继今年3月份的WinHEC春季大会,秋季大会于11月10日-11日深圳如期举行.此次大会的主题是Windows 10 IoT和Microsoft Azure,云和端的无缝连接是微软物联网解决方案的典型 ...
- RabbitMQ详解
本文地址:http://www.host900.com/index.php/articles/351/ 介绍RabbitMQ前,有必须先了解一下AMQP协议.AMQP协议是一个高级抽象层消息通信协议, ...
- Hadoop总结篇之四---底层通信是怎么做到的
上一篇介绍了一个job的提交过程.期间多次提到通信协议.那么协议是什么? 协议其实就是通信的双方所遵守的一套规范,这套规范规定了通信时传输的数据的固定的格式. 4.1 RPC协议:在hadoop中,我 ...
- opengl入门学习
OpenGL入门学习 说起编程作图,大概还有很多人想起TC的#include <graphics.h>吧? 但是各位是否想过,那些画面绚丽的PC游戏是如何编写出来的?就靠TC那可怜的640 ...
- msvc2013编译qt5.6源码
1.回顾 说起到qt的编译,真是领人痛心啊,不仅编译选项繁多,而且编译时间比较久,总是能使想编译qt源码的人望而却步,呵呵...我就是其中一个,不知道从什么时候开始就想着把qt的源码编译一下,也尝试过 ...
- Nodejs生态圈的TypeScript+React
基于Nodejs生态圈的TypeScript+React开发入门教程 基于Nodejs生态圈的TypeScript+React开发入门教程 概述 本教程旨在为基于Nodejs npm生态圈的前端程 ...
随机推荐
- Spring中的DataBinding(二) - Validation
@Controller@RequestMapping(value = "/custom/register")public class RegistrationController ...
- EntityFramework+Autofac+MVC+EasyUI 搭建公司基本服务项目
去年年底用了2个星期的时间搭建了 这套框架,从ORM,IOC,MVC,EasyUI都仔细的研究了下,还有日志,异常等等.mvc 我已经开发过很多项目了,我就觉得自己写套框架,看看自己的水平如何.欢迎大 ...
- centos vim的安装目录在哪里
[root@test man]# rpm -ql vim-common | grep python/usr/share/vim/vim72/autoload/pythoncomplete.vim/us ...
- 将一段含有0的字符数组赋给string
string有个成员函数,assign() 可以这样: string str; str.assign(temp, sizeof(temp));
- AdminCMD
program AdminCMD; {$APPTYPE CONSOLE} uses Windows, ShellApi, SysUtils; function RunAsAdmin(const iEx ...
- 为什么不能在scrollview中直接添加一个image,然后使animation.begin()??
http://stackoverflow.com/questions/17267451/animation-cant-begin-in-scrollview-in-windows-phone 以上是我 ...
- 如何让FPGA中的SPI与其他模块互动起来
在上一篇文章<FPGA的SPI从机模块实现>中,已经实现了SPI的从机模块,如何通过SPI总线与FPGA内部其他模块进行通信,是本文的主要讨论内容. 一. 新建FPGA内部DAC控制模块 ...
- Java的Git管理工具Gitblit
From:http://www.oschina.net/p/gitblit Gitblit 是一个纯 Java 库用来管理.查看和处理 Git 资料库.相当于 Git 的 Java 管理工具. 下载地 ...
- Eclipse被汉化后恢复EN模式
问题描述: 在安装Flush builder 的时候安装了汉化包,导致Eclipse中功能显示为汉字. 问题解决: 在Eclipse快捷方式下“目标”路径中添加-nl "EN"即可 ...
- 【LeetCode练习题】Evaluate Reverse Polish Notation
Evaluate Reverse Polish Notation Evaluate the value of an arithmetic expression in Reverse Polish No ...