DBSeer

13次阅读

共计 2208 个字符,预计需要花费 6 分钟才能阅读完成。

功能:
performance prediction, performance diagno- sis, bottleneck explanation, workload insight, optimal admission control, and what-if analysis
指标:
AggregatedOSstatistics
WorkloadstatisticsfromtheDBMS,includingthenumberof SELECT, UPDATE, DELETE and INSERT commands executed, number of flushed and dirty pages, and the total lock wait- time.
Timestampedquerylogs,containingstart-time,duration,and the SQL statements executed by the system.

1.query 分类:

similar:eg,perform similar operations on each table or ex- hibit similar patterns of resource usage. table,lock mode,rows,time between statements. DBSCAN

2. 资源预测:(Barzan Mozafari)

2.1 CPU, network, and log writes

black-box models(make minimal assumptions about the underlying system, and hence are not specific to a particular DBMS.)与 load 的线性模型

White-box models are needed for other resources (e.g., locking, page flushes due to log recycling) when making predictions about a drastically different workload than the one observed during training.
cache model【D.N.Tran,P.C.Huynh,Y.C.Tay,andA.K.H.Tung.Anew
approach to dynamic self-tuning of database buffers. Trans. Storage,
4(1), 2008.】
dirty rate~flush rate
flush rate: 比如蒙特卡洛模拟【B.Mozafari,C.Curino,andS.Madden.Performanceandresource
modeling in highly-concurrent oltp workloads. Technical report, MIT,February 2012.】

2.2 lock/IO conflicting

每个请求获取表的主键,rewrite 成获取主键,聚合索引的主键和数据在一起,获取这批请求的主键集合,根据相邻和分散性判断分布

2.3 磁盘。ram

log,dirty flush,cache miss
adaptive flushing: dirty flush 频率和 redo log recycling 时阻塞时间之间的 heuristic。不会只等 recycling 时才刷,分期偿还刷脏压力。
每个 transaction 到第 i 的概率是 pwrite,i. D 是所有 page。则 sum(pwrite,i)=1 假设一个 transaction 只写一个页
p~ 是 n 次 trans 后不同脏页的数量。Tn,i 是第 i 页被写的概率 Tn=sum(Tn,i),Tn,i=1-(1-pwrite,i)^n
log roration 分类:1,page 是脏的,第一个脏事务在旧 log 中,2,page 是脏的,第一个脏事务在新 log 中,3,page 不是脏的。第 i 页属于三类的概率 P1,i,,, 在 t 时刻属于第一类的页数为 d1,t,总长度为 L。
log roration 只能发生在 d1,t= 0 的时刻。d2,t+1=0. 假设 1s 有 n 个事务好的刷脏率

(在 lt/ n 的时间内把需要刷的 d1,t 个刷完)
蒙特卡洛模拟:初始化不同起始 l0,d1,0。预测 Ft(n)。若有 n 页,2^n 次种起始
算法:
在不刷脏的时候 Ft+1(n)=Ft(n). 所以在刚刷完时(假设 t0 时刻)有:

E(d1,t)=sum(P1,j)
以下三个在另一篇里证明,没看:

所以算法:(其中的 pwrite,i 应该是根据 2.2 事先算好的。而且根据他进行分类合并 Page)

2.4. RAM miss

Monte-Carlo simulation of the buffer pool. To estimate the miss rate for a database with N pages of RAM. 模拟根据 2.2 的分布。模拟 LUR,LRU2, 累加脏页的 Cwrite.t.n 和 miss 的 Cread.t.n

2.5 锁模型,估计 transaction delay

根据 2.2 得到 g(transation Ci 在第 n 步骤获取第 i 个 region 的数据的概率), 根据 2.2 得到 S 和 m 个 transaction 的 LR 模型。第 N 步的平均处理时间 S(指数分布)用 CPU 核数 *S/ 排队的 M 个数估计新的 S,U 是在第 n 步遇到锁的平均 delay。平均延时是 S +U.
等等调整来评估锁。基于 Thomasian’2pl analysis

2.6 黑盒

正文完
 0