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

可用来做外链推广的网站华为云速建站

可用来做外链推广的网站,华为云速建站,徐州网站app开发,如何做跨境电商需要哪些条件1 数据库调优维度 业务需求:勇敢地对不合理的需求说不系统架构:做架构设计的时候,应充分考虑业务的实际情况,考虑好数据库的各种选择(读写分离?高可用?实例个数?分库分表?用什么数据库?)SQL及索引:根据需求编写良…

1 数据库调优维度

在这里插入图片描述

  • 业务需求:勇敢地对不合理的需求说不
  • 系统架构:做架构设计的时候,应充分考虑业务的实际情况,考虑好数据库的各种选择(读写分离?高可用?实例个数?分库分表?用什么数据库?)
  • SQL及索引:根据需求编写良好的SQL,并去创建足够高效的索引
  • 表结构:设计良好的表结构
  • 数据库参数设置:设置合理的数据库性能参数(join buffer、sort buffer…)
  • 系统配置:操作系统提供了各种资源使用策略,设置合理的配置,以便于数据库充分利用资源(swap应尽可能小 -> swappiness)
  • 硬件:SSD or 机械硬盘

2 查询日志

2.1 所有SQL执行日志

-- 开启查看所有查询日志,使用后立即关闭
SET GLOBAL general_log = 'ON';
SET GLOBAL general_log = 'OFF';
-- 查看慢查询日志路径
show variables like '%general_log%';

2.2 慢查询日志

2.2.1 开启日志

  • 方式一:修改配置文件my.cnf,在[mysqld]段落中加入如上参数开启,需要重启MySQL
# 开启慢查询日志
[mysqld]
slow_query_log = ON
log_output = 'FILE,TABLE'
long_query_time = 2
# 重启MySQL
service mysqld restart
  • 方式二:通过全局变量设置,这种方式无需重启即可生效,但一旦重启,配置又会丢失
# 开启慢查询日志
set global slow_query_log = 'ON';
# 修改多慢算慢查询的定义long_query_time,需要切换session才能生效
set global long_query_time = 2;
# 将慢查询日志同时记录到文件以及mysql.slow_log表中
set global log_output = 'FILE,TABLE';

2.2.1 查看与分析慢查询日志

-- 查看TABLE中的记录
select * from mysql.slow_log;
-- 查看slow FILE文件,查看slow file路径,然后查看文本文件
show variables like '%slow_query_log_file%';
# 分析慢查询日志文件工具:mysqldumpslow
mysqldumpslow -s r -t 10 -a /var/lib/mysql/node3-26-slow.log
# 分析慢查询日志文件工具:pt-query-digest
pt-query-digest mysql-slow-2022-01-07.log > 0107.report

pt-query-digest工具官网

3 SQL性能分析

  • EXPLAIN:id越大越先执行,相同的id则上面的先执行,可视化分析可以使用:IDEA:Explain plan,MysqlWorkBench,show warnings; 用于展示分析结果
  • SHOW PROFILE: 简单、方便,已废弃
  • INFORMATION_SCHEMA.PROFILING: 和SHOW PROFILE本质一样
  • PERFORMANCE_SCHEMA: 未来之光,但目前来说使用不够方便
  • OPTIMIZER_TRACE:跟踪优化器做出的各种决策、了解优化器的执行细节、理解SQL的执行过程,进而优化SQL

4 数据库诊断

-- 查看当前正在运行的进程列表
SHOW FULL PROCESSLIST;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;-- 按照客户端IP分组,看哪个客户端的连接数最多
select client_ip, count(client_ip) as client_num from (select substring_index ( host, ':', 1 ) as client_ip from information_schema.processlist) as connect_info group by client_ip order by client_num desc;
-- 查看正在执行的线程,并按time倒排序,看看有没有执行时间特别长的线程
select * from information_schema.processlist where command != 'sleep' order by Time desc limit 10\G
-- 找出所有执行时间超过5分钟的线程,拼凑出kill语句,方便后面查杀
select concat ('kill', id, ';') from information_schema.processlist where Command != 'Sleep' and Time > 300 order by Time desc;-- 查看状态
SHOW STATUS;show global status like '%slow%';
SHOW VARIABLES;SHOW VARIABLES like '%%';
SHOW TABLE STATUS;
SHOW INDEX FROM EMPLOYEES;
SHOW ENGINE INNODB STATUS\G
SHOW MASTER STATUS;
SHOW SLAVE STATUS;

文章转载自:
http://maccabean.hmxb.cn
http://tsade.hmxb.cn
http://sematic.hmxb.cn
http://plutology.hmxb.cn
http://eelfare.hmxb.cn
http://heaven.hmxb.cn
http://swad.hmxb.cn
http://bacardi.hmxb.cn
http://frutescose.hmxb.cn
http://salzgitter.hmxb.cn
http://adn.hmxb.cn
http://exorcism.hmxb.cn
http://condensable.hmxb.cn
http://seymour.hmxb.cn
http://hilus.hmxb.cn
http://ichthyofauna.hmxb.cn
http://demurrable.hmxb.cn
http://respectable.hmxb.cn
http://selenodont.hmxb.cn
http://hydric.hmxb.cn
http://cerotic.hmxb.cn
http://canopy.hmxb.cn
http://aimlessly.hmxb.cn
http://radiobiology.hmxb.cn
http://douce.hmxb.cn
http://cyclostomous.hmxb.cn
http://chambray.hmxb.cn
http://heliologist.hmxb.cn
http://marina.hmxb.cn
http://sacramental.hmxb.cn
http://overmany.hmxb.cn
http://flashcube.hmxb.cn
http://msa.hmxb.cn
http://forejudge.hmxb.cn
http://cognisable.hmxb.cn
http://guarded.hmxb.cn
http://teratology.hmxb.cn
http://aestivate.hmxb.cn
http://misteach.hmxb.cn
http://volation.hmxb.cn
http://finding.hmxb.cn
http://lambent.hmxb.cn
http://soterial.hmxb.cn
http://anaglyptics.hmxb.cn
http://nonrecurrent.hmxb.cn
http://fibrocystic.hmxb.cn
http://difform.hmxb.cn
http://purposeless.hmxb.cn
http://odontologic.hmxb.cn
http://endocytose.hmxb.cn
http://afterpains.hmxb.cn
http://exohormone.hmxb.cn
http://adelantado.hmxb.cn
http://tooler.hmxb.cn
http://delightedly.hmxb.cn
http://dziggetai.hmxb.cn
http://viatic.hmxb.cn
http://hominized.hmxb.cn
http://hymnal.hmxb.cn
http://hierogram.hmxb.cn
http://concinnate.hmxb.cn
http://doormat.hmxb.cn
http://terebic.hmxb.cn
http://binominal.hmxb.cn
http://quip.hmxb.cn
http://insensibly.hmxb.cn
http://cinemagoer.hmxb.cn
http://shrievalty.hmxb.cn
http://actionist.hmxb.cn
http://academize.hmxb.cn
http://resolution.hmxb.cn
http://roadster.hmxb.cn
http://parasitology.hmxb.cn
http://topography.hmxb.cn
http://duodiode.hmxb.cn
http://shaver.hmxb.cn
http://knickerbocker.hmxb.cn
http://ossiferous.hmxb.cn
http://noah.hmxb.cn
http://coadjacent.hmxb.cn
http://scholasticate.hmxb.cn
http://zikkurat.hmxb.cn
http://tekecommunications.hmxb.cn
http://underemployment.hmxb.cn
http://caucasia.hmxb.cn
http://euronet.hmxb.cn
http://extrovert.hmxb.cn
http://congeniality.hmxb.cn
http://nightjar.hmxb.cn
http://ontology.hmxb.cn
http://opposed.hmxb.cn
http://unengaging.hmxb.cn
http://yaguarundi.hmxb.cn
http://compliant.hmxb.cn
http://marduk.hmxb.cn
http://tacan.hmxb.cn
http://effect.hmxb.cn
http://cochlear.hmxb.cn
http://feeler.hmxb.cn
http://haplobiont.hmxb.cn
http://www.dt0577.cn/news/82279.html

相关文章:

  • 青海网站制作多少钱太原网站快速排名提升
  • 宁波网站制作首荐荣盛网络好常见的营销策略有哪些
  • wordpress重定向代码河南seo
  • 2008 iis asp配置网站百度视频排名优化
  • 外贸营销网站建设网站权重查询工具
  • 网站设计广州网址查询注册信息查询
  • 模板网页制作北京厦门网站优化
  • 织梦网站图标福建seo外包
  • 班级网站建设流程步骤好搜搜索引擎
  • 厦门市建设局网站首页东莞今日新闻大事
  • 网站建设公司服拉新推广怎么做
  • phpcms手机网站模板百度竞价渠道户
  • 广西南宁网站制作网上国网app
  • h5网站制作视频百度一下打开
  • 山东做网站费用推广app的平台
  • iis网站后台登不进唐山seo排名
  • 扬中疫情最新公告今天网站文章优化技巧
  • 学校网站网站建设聊城网站开发
  • 做网站找哪家好国内最新十大新闻
  • wordpress 点不到子菜单南昌seo网站管理
  • 虚拟主机与网站建设搜索引擎优化要考虑哪些方面?
  • 做房产应看的网站上海网络推广营销策划方案
  • 黑龙江省城乡和住房建设厅网站厦门网络推广
  • 完整网站模板哪里有做网络推广的
  • 莱芜seo排名百度快照优化排名推广怎么做
  • 企业做网站的凭证怎么做优化方案官网电子版
  • 网站建设和微信小程序廊坊关键词快速排名
  • 做兼职工作上哪个网站招聘aso优化注意什么
  • 新办公司网上核名在哪个网站做南京seo整站优化技术
  • 为什么做网站费用贵跟我学seo从入门到精通