当前位置: 首页 > news >正文

游戏网站怎么赚钱福州网站怎么做的

游戏网站怎么赚钱,福州网站怎么做的,破解软件库合集资料网址大全,深圳可以做网站的公司问题 最近遇到 2 个超大 sql 文件导入#xff0c;好一通折腾 文档在哪里 调优参数太多#xff0c;文档都看不过来 找到这些参数也费劲, ubuntu 在 /etc/mysql/mysql.conf.d/mysqld.cnf 中找到这个链接 ...... # # The MySQL Server configuration file. # # For explanat…问题 最近遇到 2 个超大 sql 文件导入好一通折腾 文档在哪里 调优参数太多文档都看不过来 找到这些参数也费劲, ubuntu 在 /etc/mysql/mysql.conf.d/mysqld.cnf 中找到这个链接 ...... # # The MySQL Server configuration file. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.htmlcentos 7 在 /etc/my.cnf 中找到这个链接 # For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html官方调优文档 14.15 InnoDB Startup Options and System Variables 耐心去阅读文档中那么多参数需要勇气 最终我也是从这里 mysql使用多cpu抄来的 # wzh 20230814# Set the number of CPUs to be used by MySQL # # to half of the total available CPUsinnodb_thread_concurrency 2## Set the number of buffer pool instancesinnodb_buffer_pool_instances 2# # # Set the size of the query cachequery_cache_size 64M## wzh 20230814 bulk_insert_buffer_size 2Ginnodb_log_buffer_size 2Ginnodb_autoinc_lock_mode 2#调优后 三种导入方式对比 方式一: 使用 mysql source 命令直接导入一个大文件 (18G) 为了统计用时和绘画内部优化将实际mysqldump 文件包含到 all.sql # cat all.sqlSET GLOBAL innodb_lru_scan_depth256;set session sql_mode ALLOW_INVALID_DATES;SET autocommit0;SET unique_checks0;SET foreign_key_checks0;show global variables like innodb_lru_scan_depth;show variables like %sql_mode%; show variables like %autocommit;show variables like %unique_checks;show variables like %foreign_key_checks;select now();-- one file 18Gsource /home/XXXdata/20191230_135112.sql;show global variables like innodb_lru_scan_depth;show variables like %sql_mode%;show variables like %autocommit;show variables like %unique_checks;show variables like %foreign_key_checks;select now();导入过程 mysql tee out-20230816.txtmysql source /home/XXXdata/all.sql查看结果 # cat out-20230816.txt......| 2023-08-16 08:17:02 |......| 2023-08-16 14:26:40 |总共耗时 6 小时 方式2⃣️: 使用shell 命令行后台任务直接导入一个大文件 (18G) 为了统计用时和绘画内部优化将实际mysqldump 文件包含到 all.sql # cat all.sql 同前一个方式shell 后台任务 # nohup mysql -uroot -pPassword123 --default-character-setutf8 --force zXXX /home/zXXX/all.sql /home/out-20230817.txt 21 查看执行结果 # cat out-20230817.txt......2023-08-16 21:08:52......2023-08-17 01:43:14用时 大约5 小时 方式三SQLDumpSplitter切割 sql 文件 ( 每个 2G)使用 mysql source 命令 切割后的结果 # ls *.sql -l-rw-r--r--. 1 root root 2147482476 8月 10 14:13 20191230_135112_0.sql-rw-r--r--. 1 root root 2147482521 8月 10 14:15 20191230_135112_1.sql-rw-r--r--. 1 root root 2147482263 8月 10 14:17 20191230_135112_2.sql-rw-r--r--. 1 root root 2147482371 8月 10 14:19 20191230_135112_3.sql-rw-r--r--. 1 root root 2147481971 8月 10 14:21 20191230_135112_4.sql-rw-r--r--. 1 root root 2147481699 8月 10 14:24 20191230_135112_5.sql-rw-r--r--. 1 root root 2147482612 8月 10 14:25 20191230_135112_6.sql-rw-r--r--. 1 root root 2147482594 8月 10 14:27 20191230_135112_7.sql-rw-r--r--. 1 root root 959044232 8月 10 14:28 20191230_135112_8.sql-rw-r--r--. 1 root root 1096 8月 16 14:14 all.sqlall.sql # cat all.sql SELECT DATABASE();select now();SET GLOBAL innodb_lru_scan_depth256;set session sql_mode ALLOW_INVALID_DATES;SET autocommit0;SET unique_checks0;SET foreign_key_checks0;show global variables like innodb_lru_scan_depth;show variables like %sql_mode%; show variables like %autocommit;show variables like %unique_checks;show variables like %foreign_key_checks;-- 00source /home/XXXdata/20191230_135112_0.sql ;-- 01source /home/XXXdata/20191230_135112_1.sql ;-- 02source /home/XXXdata/20191230_135112_2.sql ;-- 03source /home/XXXdata/20191230_135112_3.sql ;-- 04source /home/XXXdata/20191230_135112_4.sql ;-- 05source /home/XXXdata/20191230_135112_5.sql ;-- 06source /home/XXXdata/20191230_135112_6.sql ;-- 07source /home/XXXdata/20191230_135112_7.sql ;-- 08source /home/XXXdata/20191230_135112_0.sql ;-- ALL OKshow global variables like innodb_lru_scan_depth;show variables like %sql_mode%;show variables like %autocommit;show variables like %unique_checks;show variables like %foreign_key_checks;SELECT DATABASE();select now();导入过程 mysql tee out-20230816.txtmysql source /home/XXXdata/all.sql查看结果 cat out-20230816.txt......| 2023-08-16 08:17:02 |......| 2023-08-16 13:15:21 | 总共耗时大约 5 小时 不调优使用shell 命令行后台任务直接导入一个大文件 (18G) 注释掉 my.cnf 中的调优 restart mysqld 服务 # cat /etc/my.cnf# wzh 20230814# Set the number of CPUs to be used by MySQL # # to half of the total available CPUs# innodb_thread_concurrency 2## Set the number of buffer pool instances#innodb_buffer_pool_instances 2# # Set the size of the query cache# query_cache_size 64M## wzh 20230814 # bulk_insert_buffer_size 2G# innodb_log_buffer_size 2G# innodb_autoinc_lock_mode 2# wzh 20230817# default-time-zoneAsia/Shanghaiexplicit_defaults_for_timestamptruelog_timestampsSYSTEM这就和安装完 mysql 5.7 之后全部使用缺省值一样了 shell 后台任务 nohup mysql -uroot -pPassword123 --default-character-setutf8 --force zXXX /home/zXXX/all.sql /home/out-20230817.txt 21 查看结果 cat /home/out-20230817.txt … 2023-08-18 14:50:11 … 2023-08-18 19:43:37 大约 5 小时对比前面调优没有多大改进 原因分析 决定实际完成快慢的是该进程的 CPU 占用时间 cputime 以下是中途记录的一段 # ps -eo pid,euid,euser,lstart,etime,cputime,cmd | grep mysql ...1877 0 root Fri Aug 18 08:22:21 2023 01:20:06 00:00:59 mysql -uroot -px xxxxxxxxxx --default-character-setutf8 --force zXXX ...可以看到本次运行时间 01:20:06 CPU 占用时间 00:00:59 说明效率很高 之前曾经有过运行一晚上实际 cputime 才 2 个小时效率太低了 总结 切割 SQL 文件并不能显著改善导入速度 也许我切割到 2G 还是太大了感觉应该 1G 使用 shell 命令行 和 mysql source 命令要快大约 20%-30% 使用多 CPU 和增加缓存等办法没有测出有明显效果 影响导入速度的还是导入过程中的错误忽略 sql_mode ‘ALLOW_INVALID_DATES’ 和 autocommit 等优化 shell 命令行 加上 --force 不要同时执行 2 个或以上大任务互相影响 提前判断好需要的硬盘空间不要等最后才知道 disk full 前功尽弃 查看磁盘空间 df -h 如果可以找到原始的数据库来源查看数据库文件大小 $ sudo du -sh /var/lib/mysql/zXXX 26G /var/lib/mysql/zXXX
http://www.hkea.cn/news/14513065/

相关文章:

  • 如何在网站后台添加商品大型彩灯制作公司
  • 网站建设与制作dw8教程做网站的相关教程
  • 网站推广的主要方法东莞建设网站公司哪家好
  • 用邮箱做网站千博网站管理系统安装
  • 游戏开发需要学多久优化是什么意思?
  • 小创业公司网站怎么做深圳建筑信息平台
  • 定制营销型网站制作网站搜索怎么做
  • 网站服务器配置参考指南网站被主流搜索引擎收录的网页数量是多少
  • 企业网站软件注册公司的流程有哪些
  • 这么开网站广告推广投放平台
  • wordpress电影资源网站兰州seo优化入门
  • 黄山企业网站建设微信小程序后端开发教程
  • 网站搭建博客百度企查查官网
  • 电子商务网站预算模板自己名字怎么设计logo
  • 中国建设工程造价管理协会登录网站青岛网站制作定制
  • asp网站密码网站建设目的要求
  • 安徽工业大学两学一做网站wordpress怎么安装asp主题
  • 网站功能提升权限昆明做网站建设怎么样
  • wordpress 网站导航代做计算机毕业设计网站
  • l林州住房建设部官方网站电商网站数据中心建设方案
  • 河北做it的网站深圳网站开发ucreator
  • 网站一键生成app微信小程序里的音乐音频怎么删除
  • 做短视频网站好当今做啥网站致富
  • 免费网站打包app广东网页空间代理
  • 国内出名网站建设设计公司郑州app开发公司定制外包
  • 自己建设网站流程wordpress手机页面模板
  • 好用的网站模板价格低文案
  • 站群网站源码体育直播网站源码
  • 电影网站app怎么做的百度网站大全首页
  • 电商企业网站源码音乐网站禁止做浅度链接