(Shuhei Tanuma) GREE, inc. Infrastructure Department Service Reliability Team Major: PHP(core), MySQL, KVS PECL Maintainer (ProtocolBuffers, Sundown. and several experimental extensions) 最近フリー素材化されたけどふとましい https://github.com/blog/1854-‐‑‒octotales-‐‑‒gree
Should be able to remove server from cluster https://github.com/influxdb/influxdb/issues/322 というIssueがあるようにClusteringができるけれど異異 常系の動作などが⾃自動で⾏行行えるわけではなさそう。 go-‐‑‒raftがわかっていれば⼿手動でどうにでもなる部分なの でゴリゴリできるならClusteringもありだと思う。 38
+ flex & Bison ɾSQL-ish Query Language SQLっぽいけどSQLと期待して書くとハマるところがある select ua, count(ua) from series group by ua order by count desc limit 10 order by句句は存在せずtimeに対してのorder句句のみ。上述のクエリは後 で説明するhaving patchを追加することで1queryで実⾏行行可能になる select * from series where time >= now() -‐‑‒1h 時間に対しての>=, <=は使えない 50
Pipeline Server / Shard Server / Shard Server / Shard Server / Shard Client Select count(elapsed) from access group by time(5m) 1) Query 2) Server/Shardsに対して Query実⾏行行 3) Compute Locality (shard内でAggregationする) 4) 処理理結果をStreamで返す 5) 結果を集約して返す 56
Pipeline (no locality) Server / Shard Server / Shard Server / Shard Server / Shard Client Select count(elapsed) from access group by time(5m) 1) Query 2) Server/Shardsに対して Query実⾏行行 3) Streamでそのまま帰す 4) 結果を集約して返す 58
▪server.host1.cpuのseriesから1分毎で平均を算出した結果 を返す SELECT MEAN(cpu_̲user) as user_̲mean FROM server.host1.cpu GROUP BY TIME(1m) WHERE time > now() -‐‑‒ 1h; 61
▪server.host1.cpuのseriesから1分毎で平均を算出した結果 を返す。値がない場合は0.0で埋める(地味に便便利利) SELECT MEAN(cpu_̲user) as user_̲mean FROM server.host1.cpu GROUP BY TIME(1m) FILL(0.0) WHERE time > now() -‐‑‒ 1h; 62
Continuous Query select percentile(value, 95) from response_times group by time(5m) into response_times.percentiles.5m.95 Fanout, downsampling select max(value) from /stats\.*/ group by time(5m) into max.:series_name select * from access into access.[action] into句句を使うこと別seriesにfanoutすることができる。 Continuous Queryまだまだ⾊色々制限が多いが今後改善される⾒見見込み 63
protobuf bison flex leveldb go hg bzr git clone https://github.com/influxdb/influxdb cd influxdb export GOPATH=`pwd` # assume your flex and bison version. ./configure --with-flex=/usr/local/Cellar/flex/2.5.37/ bin/flex --with-bison=/usr/local/Cellar/bison/3.0.2/ bin/bison && make build sed -i ‘s/log/stdout/’ config.sample.toml ./daemon -config=config.sample.toml # Testing make test, make test <component>
patch Analytics系のクエリをInfluxDBでやるときhaving系がな かったので⾟辛かった https://github.com/influxdb/influxdb/pull/611 このpatchによりhaving clauseが実⾏行行できるので select action, mean(elapsed) mean_elapsed from access where time > now() -7h group by time(1m) having top(mean_elapsed, 10) みたいなサマリ系のクエリが簡単にできるようになった 多分近いうちにmergeされると思う 107