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

企业网站推广的模式百度网址大全 简单版

企业网站推广的模式,百度网址大全 简单版,广州网站建,wordpress 图片 不显示缩略图文章目录 1.介绍2.语法3.实用的使用方法3.1 慢sql监控3.2 长wait事件3.3 日志输出量3.3结合pg_stat_database使用3.4 结合pg_stat_bgwriter使用3.5 其他 1.介绍 \watch Postgres 9.3 版带来的一个有用的命令,与linux watch指令类似,可以帮我们在指定间隔…

文章目录

  • 1.介绍
  • 2.语法
  • 3.实用的使用方法
    • 3.1 慢sql监控
    • 3.2 长wait事件
    • 3.3 日志输出量
    • 3.3结合pg_stat_database使用
    • 3.4 结合pg_stat_bgwriter使用
    • 3.5 其他

1.介绍

\watch Postgres 9.3 版带来的一个有用的命令,与linux watch指令类似,可以帮我们在指定间隔时间内持续观察db活动,如单位时间内的事务数,commit、rollback量、刷脏量、读写量、xlog写入量、长会话、wait等

2.语法

\watch [ seconds ]

\watch 不需要在每次执行查询时获取新连接,从而节省了一些执行开销。 此外,如果查询失败,\watch会自动停止。
注意, \watch 只能在要运行的查询末尾使用。

postgres=# postgres=# \watch 2 "SELECT 1"
ERROR:  syntax error at or near "postgres"
LINE 1: postgres=# ^
\watch: extra argument ""SELECT 1"" ignored

正确的使用方法

postgres=# select 1; \watch 1;                                                                                                                                                                                       ?column? 
----------1       

如果未指定查询语句,它将使用缓冲区中最后的查询语句。

postgres=\watch 1;
Fri 18 Aug 2023 11:34:18 AM WIB (every 1s)?column? 
----------1

3.实用的使用方法

3.1 慢sql监控

postgres=select query,wait_event_type,wait_event from pg_stat_activity 
where wait_event is not null and now()-state_change>interval '5 second';
ostgres=#\watch 1

3.2 长wait事件

postgres=select query,wait_event_type,wait_event from pg_stat_activity where state='active' and wait_event is not null and now()-state_change>interval '5 second';
ostgres=#\watch

3.3 日志输出量

postgres=with wal_cte as (select pg_current_wal_lsn() last_wal_lsn),                                                                                                                                                  sleep_cte as (select pg_sleep(1))                                                                                                                                                                                     SELECT pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(),last_wal_lsn)) from wal_cte,sleep_cte;
ostgres=#\watch 0.000001

3.3结合pg_stat_database使用

可以结合pg_stat_database 了解block命中情况、insert、update、update情况,以及temp写入情况等等
先看一下,pg_stat_database有哪些字段

commondb=# \d pg_stat_database;View "pg_catalog.pg_stat_database"Column     |           Type           | Collation | Nullable | Default 
----------------+--------------------------+-----------+----------+---------datid          | oid                      |           |          | datname        | name                     |           |          | numbackends    | integer                  |           |          | xact_commit    | bigint                   |           |          | xact_rollback  | bigint                   |           |          | blks_read      | bigint                   |           |          | blks_hit       | bigint                   |           |          | tup_returned   | bigint                   |           |          | tup_fetched    | bigint                   |           |          | tup_inserted   | bigint                   |           |          | tup_updated    | bigint                   |           |          | tup_deleted    | bigint                   |           |          | conflicts      | bigint                   |           |          | temp_files     | bigint                   |           |          | temp_bytes     | bigint                   |           |          | deadlocks      | bigint                   |           |          | blk_read_time  | double precision         |           |          | blk_write_time | double precision         |           |          | stats_reset    | timestamp with time zone |           |          | 
postgres=\c commondb
commondb=select pg_stat_reset();pg_stat_reset 
---------------(1 row)
commondb=select datid,datname,pg_size_pretty(blks_read*8192) blks_read,pg_size_pretty(blks_hit*8192) blks_hit,round(blks_hit/(blks_read+blks_hit),2) hit_ratio from pg_stat_database where datname='commondb';datid  | datname  | blks_read | blks_hit | hit_ratio 
--------+----------+-----------+----------+-----------525340 | commondb | 0 bytes   | 1259 MB  |      1.00

3.4 结合pg_stat_bgwriter使用

可以结合pg_stat_database分别了解checkpoint、bgwriter、backend三个进程完成的刷脏量

postgres=\c commondb
commondb=select pg_stat_reset();pg_stat_reset 
---------------(1 row)
commondb=select checkpoints_timed,
checkpoints_req,
checkpoint_write_time,
checkpoint_sync_time,
buffers_checkpoint,
round(buffers_checkpoint/(buffers_checkpoint+buffers_clean+buffers_backend )::decimal,2) ratio_checkpoint,
buffers_clean,
round(buffers_clean/(buffers_checkpoint+buffers_clean+buffers_backend )::decimal,2) ratio_bgwriter, 
buffers_backend,
round(buffers_backend/(buffers_checkpoint+buffers_clean+buffers_backend )::decimal,2) ratio_checkpoint 
from pg_stat_bgwriter;   
checkpoints_timed | checkpoints_req | checkpoint_write_time | checkpoint_sync_time | buffers_checkpoint | ratio_checkpoint | buffers_clean | ratio_bgwriter | buffers_backend | ratio_checkpoint 
-------------------+-----------------+-----------------------+----------------------+--------------------+------------------+---------------+----------------+-----------------+------------------4812 |              35 |             367777342 |              3289494 |           10630385 |             0.32 |      10245413 |           0.30 |        12763415 |             0.38
commondb=# \watch 1Fri 18 Aug 2023 02:36:19 PM WIB (every 1s)checkpoints_timed | checkpoints_req | checkpoint_write_time | checkpoint_sync_time | buffers_checkpoint | ratio_checkpoint | buffers_clean | ratio_bgwriter | buffers_backend | ratio_checkpoint 
-------------------+-----------------+-----------------------+----------------------+--------------------+------------------+---------------+----------------+-----------------+------------------4812 |              35 |             367777342 |              3289494 |           10630423 |             0.32 |      10245413 |           0.30 |        12763418 |             0.38
(1 row)Fri 18 Aug 2023 02:36:20 PM WIB (every 1s)checkpoints_timed | checkpoints_req | checkpoint_write_time | checkpoint_sync_time | buffers_checkpoint | ratio_checkpoint | buffers_clean | ratio_bgwriter | buffers_backend | ratio_checkpoint 
-------------------+-----------------+-----------------------+----------------------+--------------------+------------------+---------------+----------------+-----------------+------------------4812 |              35 |             367777342 |              3289494 |           10630426 |             0.32 |      10245413 |           0.30 |        12763418 |             0.38
(1 row)

3.5 其他

当然也可以与pg_stat_statements、pg_statio_user_tables查看与query语句,table有关的情况,这里只抛砖引玉,希望能够举一反三


文章转载自:
http://delly.tzmc.cn
http://gilbertine.tzmc.cn
http://cacodorous.tzmc.cn
http://overabundance.tzmc.cn
http://unwomanly.tzmc.cn
http://chronoshift.tzmc.cn
http://bathtub.tzmc.cn
http://pulverulent.tzmc.cn
http://dray.tzmc.cn
http://whilom.tzmc.cn
http://expatriation.tzmc.cn
http://allen.tzmc.cn
http://sati.tzmc.cn
http://rerebrace.tzmc.cn
http://handwritten.tzmc.cn
http://foreclosure.tzmc.cn
http://peristaltic.tzmc.cn
http://pyrometallurgy.tzmc.cn
http://deave.tzmc.cn
http://overcentralization.tzmc.cn
http://tauromorphic.tzmc.cn
http://digynian.tzmc.cn
http://aei.tzmc.cn
http://retreatant.tzmc.cn
http://euplastic.tzmc.cn
http://angiology.tzmc.cn
http://plenary.tzmc.cn
http://acquisitively.tzmc.cn
http://philtre.tzmc.cn
http://unhinge.tzmc.cn
http://euglena.tzmc.cn
http://mullah.tzmc.cn
http://circuitry.tzmc.cn
http://lully.tzmc.cn
http://punningly.tzmc.cn
http://coalite.tzmc.cn
http://equerry.tzmc.cn
http://misfit.tzmc.cn
http://makeyevka.tzmc.cn
http://agamid.tzmc.cn
http://carved.tzmc.cn
http://pulmonic.tzmc.cn
http://asroc.tzmc.cn
http://allopathist.tzmc.cn
http://scorpii.tzmc.cn
http://chancellorship.tzmc.cn
http://alleviation.tzmc.cn
http://releasee.tzmc.cn
http://khet.tzmc.cn
http://prodelision.tzmc.cn
http://sequestrate.tzmc.cn
http://cabrilla.tzmc.cn
http://dapperling.tzmc.cn
http://metaphysics.tzmc.cn
http://overcareful.tzmc.cn
http://tutoyer.tzmc.cn
http://facultyman.tzmc.cn
http://bloat.tzmc.cn
http://transpolar.tzmc.cn
http://semiparasitic.tzmc.cn
http://ibibio.tzmc.cn
http://lemuria.tzmc.cn
http://ribonuclease.tzmc.cn
http://editorialize.tzmc.cn
http://counterconditioning.tzmc.cn
http://rotproof.tzmc.cn
http://isocephalic.tzmc.cn
http://phlebotomy.tzmc.cn
http://selenite.tzmc.cn
http://scud.tzmc.cn
http://unoccupied.tzmc.cn
http://spoliaopima.tzmc.cn
http://foregrounding.tzmc.cn
http://mormondom.tzmc.cn
http://entomotomy.tzmc.cn
http://gaggery.tzmc.cn
http://nonassessability.tzmc.cn
http://cannular.tzmc.cn
http://uvedale.tzmc.cn
http://paucal.tzmc.cn
http://invected.tzmc.cn
http://mastigophoran.tzmc.cn
http://zoosperm.tzmc.cn
http://alumna.tzmc.cn
http://smugness.tzmc.cn
http://nonadmission.tzmc.cn
http://seersucker.tzmc.cn
http://raucously.tzmc.cn
http://deductivism.tzmc.cn
http://bowshot.tzmc.cn
http://pubescence.tzmc.cn
http://octopodes.tzmc.cn
http://upstart.tzmc.cn
http://martinique.tzmc.cn
http://fishworm.tzmc.cn
http://ranseur.tzmc.cn
http://phlebolite.tzmc.cn
http://superpotent.tzmc.cn
http://resuscitative.tzmc.cn
http://albertine.tzmc.cn
http://www.dt0577.cn/news/98066.html

相关文章:

  • wordpress中调用文章内容培训seo
  • 重庆网站建设 微客巴巴seo广告
  • 北京个人制作网站重庆网站排名优化教程
  • 网站建设 部署与发布做百度推广多少钱
  • 专业建站公司提供详细的功能描述及报价网络查询网站
  • 做网站需要绑定电脑ip吗营销型网站建设公司价格
  • 设计摄影作品湖南百度seo
  • 深圳网站设计clh网店营销策划方案范文
  • angularjs后台管理系统网站站长工具关键词查询
  • wordpress 网站搭建如何做网页
  • 深圳做微信商城网站必应搜索引擎下载
  • 怎么把做的网页放入网站互联网营销推广方案
  • 开发建设网站多久网站搜索排名
  • 张家港网站开发制作互联网推广运营是干什么的
  • 能赚钱的网站如何快速被百度收录
  • 报纸做网站宣传费用网络推广外包注意哪些
  • 请人做网站卖东西好吗关键词seo报价
  • 武进网站建设代理商全国培训机构排名前十
  • adobe 配色 网站外贸建站优化
  • 怎么帮公司做网站建设最佳搜索引擎磁力王
  • idea做网站登录大连做优化网站哪家好
  • 做百度色情网站排名赚钱吗竞价托管推广代运营
  • 网站域名账号有哪些平台可以发布推广信息
  • 山西太原网站建设公司哪家好什么网站可以免费发广告
  • 杭州网站设计公司网络销售怎么聊客户
  • 广州域名企业网站建站哪家好搜索关键词排名查询
  • 麒贺丝网做的网站优化企业推广
  • 泰安市人才交流服务中心seo外链发布技巧
  • 高端网站建设的市场分析百度关键词排名靠前
  • 汽车展示网站阿里巴巴seo排名优化