rabbit-slide-kou-nginx-tech-talks 2016.2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rabbit +1 -0
- data/README.rd +44 -0
- data/Rakefile +34 -0
- data/config.yaml +24 -0
- data/images/groonga-icon-full-size.svg +97 -0
- data/images/groonga-logo.svg +118 -0
- data/images/ngx_http_groonga.svg +1525 -0
- data/images/register.svg +2276 -0
- data/images/search.svg +2387 -0
- data/ngx-http-groonga.rab +203 -0
- data/pdf/nginx-tech-talks-ngx-http-groonga.pdf +0 -0
- data/theme.rb +3 -0
- data/throughput-no-keep-alive.pdf +0 -0
- data/throughput-with-keep-alive.pdf +0 -0
- data/throughput.data +11 -0
- data/throughput.gnuplot +53 -0
- metadata +89 -0
@@ -0,0 +1,203 @@
|
|
1
|
+
= ngx_http_groonga\n全文検索nginx
|
2
|
+
|
3
|
+
: author
|
4
|
+
須藤功平
|
5
|
+
: institution
|
6
|
+
クリアコード
|
7
|
+
: content-source
|
8
|
+
nginx Tech Talks
|
9
|
+
: date
|
10
|
+
2016-02-08
|
11
|
+
: allotted-time
|
12
|
+
5m
|
13
|
+
: theme
|
14
|
+
.
|
15
|
+
|
16
|
+
= nginx
|
17
|
+
|
18
|
+
* HTTPサーバー
|
19
|
+
* HTTPリバースプロキシサーバー
|
20
|
+
* (('wait'))メールプロキシサーバー
|
21
|
+
* (('wait'))TCPプロキシサーバー\n
|
22
|
+
(('note:1.9.0から。まだmainline。'))
|
23
|
+
|
24
|
+
(('wait'))
|
25
|
+
(('tag:center'))
|
26
|
+
nginx = いろいろできるサーバー
|
27
|
+
|
28
|
+
= 全文検索nginx
|
29
|
+
|
30
|
+
* HTTPサーバー
|
31
|
+
* HTTPリバースプロキシサーバー
|
32
|
+
* メールプロキシサーバー
|
33
|
+
* TCPプロキシサーバー
|
34
|
+
* [((*New!*))]全文検索エンジン!
|
35
|
+
|
36
|
+
= 使い方:登録
|
37
|
+
|
38
|
+
# image
|
39
|
+
# src = images/register.svg
|
40
|
+
# relative_height = 100
|
41
|
+
|
42
|
+
= 使い方:検索
|
43
|
+
|
44
|
+
# image
|
45
|
+
# src = images/search.svg
|
46
|
+
# relative_height = 100
|
47
|
+
|
48
|
+
= 速度:1リクエスト
|
49
|
+
|
50
|
+
# CPU:core i7・8コア・ハイパースレッディング
|
51
|
+
#
|
52
|
+
# ソース:Wikipedia日本語版
|
53
|
+
# レコード数:1846514
|
54
|
+
# データサイズ:約7GB
|
55
|
+
# キーワード:nginx
|
56
|
+
# ヒット数:26件
|
57
|
+
# 検索時間(出力レコード数0):0.4ms
|
58
|
+
# 検索時間(出力レコード数10・タイトルのみ出力):0.6ms
|
59
|
+
# 検索時間(出力レコード数10・タイトルと本文を出力):2ms
|
60
|
+
|
61
|
+
* 対象:Wikipedia日本語版
|
62
|
+
* レコード数:約185万件
|
63
|
+
* データサイズ:約7GB
|
64
|
+
* 検索キーワード:nginx
|
65
|
+
|
66
|
+
(('wait'))
|
67
|
+
(('tag:center'))
|
68
|
+
(('tag:x-large'))
|
69
|
+
0.6ms\n
|
70
|
+
(('note:Intel Core i7-6700 3.40GHz'))
|
71
|
+
|
72
|
+
= 速度:スループット
|
73
|
+
|
74
|
+
# ベンチマーク(出力レコード数10・タイトルのみ出力・ワーカー数8・有線LANで接続)
|
75
|
+
|
76
|
+
# image
|
77
|
+
# src = throughput-no-keep-alive.pdf
|
78
|
+
# relative_height = 90
|
79
|
+
|
80
|
+
(('tag:center'))
|
81
|
+
(('note:ワーカー数を増やすとCPUコア数までスケール'))
|
82
|
+
|
83
|
+
= 速度:スループット
|
84
|
+
|
85
|
+
# image
|
86
|
+
# src = throughput-with-keep-alive.pdf
|
87
|
+
# relative_height = 90
|
88
|
+
|
89
|
+
(('tag:center'))
|
90
|
+
(('note:クライアントがkeep-aliveを使うとさらにスケール'))
|
91
|
+
|
92
|
+
= 速度
|
93
|
+
|
94
|
+
* 1リクエストの処理も速い
|
95
|
+
* スループットも出る
|
96
|
+
* ワーカー数を増やすとスケール
|
97
|
+
* keep-aliveでさらにスケール
|
98
|
+
|
99
|
+
= 速さの理由
|
100
|
+
|
101
|
+
* (('wait'))本物の全文検索エンジンを組込
|
102
|
+
* →1リクエストの処理が速い\n
|
103
|
+
(('note:(しかも豊富な機能)'))
|
104
|
+
* (('wait'))それもnginxのよさを殺さずに
|
105
|
+
* 例:マルチプロセスでスケール
|
106
|
+
* 例:性能向上用のHTTPの機能を利用\n
|
107
|
+
(('note:(keep-alive、レスポンス圧縮など)'))
|
108
|
+
* 例:I/O多重化(('note:(同時接続数の増加に対応)'))
|
109
|
+
|
110
|
+
= 本物の全文検索エンジン
|
111
|
+
|
112
|
+
# image
|
113
|
+
# src = images/groonga-logo.svg
|
114
|
+
# relative_width = 100
|
115
|
+
|
116
|
+
(('tag:center'))
|
117
|
+
(ぐるんが)
|
118
|
+
|
119
|
+
= Groonga
|
120
|
+
|
121
|
+
* 速い
|
122
|
+
* (('wait'))日本語に強い(国産)
|
123
|
+
* (('wait'))ライブラリーとして使える
|
124
|
+
* ((*組み込みやすい*))
|
125
|
+
* (('wait'))((*マルチプロセス*))対応
|
126
|
+
* 複数のプロセスで同時にDBを使える
|
127
|
+
|
128
|
+
= 組込方法
|
129
|
+
|
130
|
+
モジュール
|
131
|
+
|
132
|
+
= ngx_http_groonga
|
133
|
+
|
134
|
+
# image
|
135
|
+
# src = images/ngx_http_groonga.svg
|
136
|
+
# relative_height = 100
|
137
|
+
|
138
|
+
= Groongaから見たメリット
|
139
|
+
|
140
|
+
* nginxと連携すると…
|
141
|
+
* (('wait'))プロセス管理を任せられる
|
142
|
+
* (('wait'))クライアントとのI/Oを任せられる
|
143
|
+
* (('wait'))keep-alive・認証・TLS・圧縮対応
|
144
|
+
* (('wait'))HTTP2対応(('note:(まだmainline)'))
|
145
|
+
|
146
|
+
(('wait'))
|
147
|
+
(('tag:center'))
|
148
|
+
全文検索に集中できる!
|
149
|
+
|
150
|
+
= 困ったこと
|
151
|
+
|
152
|
+
* nginxのWindows用バイナリーを\n
|
153
|
+
GNU/Linux上でビルドできない
|
154
|
+
* (('wait'))Groongaはバイナリーを配布したい
|
155
|
+
* (('wait'))Windowsが必要だとリリース作業がツライ
|
156
|
+
|
157
|
+
= 対策
|
158
|
+
|
159
|
+
(('wait'))
|
160
|
+
パッチを送る
|
161
|
+
|
162
|
+
= 結果
|
163
|
+
|
164
|
+
(('wait'))
|
165
|
+
取り込まれた\n
|
166
|
+
(('note:(1.7.7 released at 2014-10-28)'))
|
167
|
+
|
168
|
+
= パッチが取り込まれるまで
|
169
|
+
|
170
|
+
* (('wait'))hgでパッチを作る
|
171
|
+
* (('wait'))メーリングリストに送る
|
172
|
+
* (('wait'))やりとりする
|
173
|
+
* (('wait'))取り込まれる
|
174
|
+
|
175
|
+
(('wait'))
|
176
|
+
(('tag:center'))
|
177
|
+
結構反応してくれるから\n
|
178
|
+
なにかあったら送るといいよ!
|
179
|
+
|
180
|
+
= 全文検索nginx
|
181
|
+
|
182
|
+
* nginx + Groonga\n
|
183
|
+
(('note: = groonga-httpd:Groongaパッケージに含まれている'))
|
184
|
+
* (('wait'))nginxが全文検索エンジンに!
|
185
|
+
* (('wait'))nginxのモジュール機能で実装
|
186
|
+
|
187
|
+
(('wait'))
|
188
|
+
(('tag:center'))
|
189
|
+
モジュールを作って\n
|
190
|
+
nginxと共存しよう!
|
191
|
+
|
192
|
+
= お知らせ
|
193
|
+
|
194
|
+
* (('wait'))MySQL・PostgreSQLとも共存
|
195
|
+
* (('wait'))Groongaは肉の日リリース
|
196
|
+
|
197
|
+
(('wait'))
|
198
|
+
(('tag:center'))
|
199
|
+
2月9日にイベントあります!\n
|
200
|
+
\n
|
201
|
+
MySQLとPostgreSQLと\n
|
202
|
+
日本語全文検索\n
|
203
|
+
(DMM.comラボにて)
|
Binary file
|
data/theme.rb
ADDED
Binary file
|
Binary file
|
data/throughput.data
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# N connections 1 worker 4 workers 8 workers 8 workers + keep-alive
|
2
|
+
1 1693 1517 1786 1559
|
3
|
+
2 3045 3041 2910 3300
|
4
|
+
3 3454 3130 3896 4887
|
5
|
+
4 3477 4125 4699 6360
|
6
|
+
5 3433 5305 5520 7210
|
7
|
+
6 3429 5418 5750 7758
|
8
|
+
7 3400 5315 5830 8433
|
9
|
+
8 3479 5257 6252 9173
|
10
|
+
16 3431 5340 6287 11512
|
11
|
+
32 3462 5477 6101 12476
|
data/throughput.gnuplot
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
set terminal pdfcairo enhanced color transparent rounded
|
2
|
+
|
3
|
+
set key outside center top horizontal reverse Left samplen 2
|
4
|
+
unset border
|
5
|
+
set xtics scale 0
|
6
|
+
set ytics scale 0
|
7
|
+
set grid ytics linewidth 1 linetype -1
|
8
|
+
|
9
|
+
set style line 1 lt 1 lc rgbcolor "#3465a4" lw 2.5 pt 7 ps 1
|
10
|
+
set style line 2 lt 1 lc rgbcolor "#edd400" lw 2.5 pt 7 ps 1
|
11
|
+
set style line 3 lt 1 lc rgbcolor "#888a85" lw 2.5 pt 5 ps 1
|
12
|
+
set style line 4 lt 1 lc rgbcolor "#f57900" lw 2.5 pt 5 ps 1
|
13
|
+
set style line 5 lt 1 lc rgbcolor "#ad7fa8" lw 2.5 pt 9 ps 1
|
14
|
+
set style line 6 lt 1 lc rgbcolor "#4e9a06" lw 2.5 pt 9 ps 1
|
15
|
+
set style line 7 lt 1 lc rgbcolor "#ef2929" lw 2.5 pt 1 ps 1
|
16
|
+
set style line 8 lt 1 lc rgbcolor "#5c3566" lw 2.5 pt 1 ps 1
|
17
|
+
set style line 9 lt 1 lc rgbcolor "#c17d11" lw 2.5 pt 3 ps 1
|
18
|
+
set style line 10 lt 1 lc rgbcolor "#dce775" lw 2.5 pt 3 ps 1
|
19
|
+
|
20
|
+
set term pdf
|
21
|
+
set xlabel "N connections"
|
22
|
+
set ylabel "requests/sec"
|
23
|
+
set yrange [0:15000]
|
24
|
+
|
25
|
+
set label 1 \
|
26
|
+
"N CPUs = 8" \
|
27
|
+
at 32,9000 right
|
28
|
+
set output "throughput-no-keep-alive.pdf"
|
29
|
+
plot "throughput.data" using 1:2:xtic(1) \
|
30
|
+
title "1 worker" \
|
31
|
+
linestyle 5 \
|
32
|
+
with lines, \
|
33
|
+
"throughput.data" using 1:3:xtic(1) \
|
34
|
+
title "4 workers" \
|
35
|
+
linestyle 2 \
|
36
|
+
with lines, \
|
37
|
+
"throughput.data" using 1:4:xtic(1) \
|
38
|
+
title "8 workers" \
|
39
|
+
linestyle 1 \
|
40
|
+
with lines
|
41
|
+
|
42
|
+
set label 1 \
|
43
|
+
"N workers = 8 (= N CPUs)" \
|
44
|
+
at 32,3000 right
|
45
|
+
set output "throughput-with-keep-alive.pdf"
|
46
|
+
plot "throughput.data" using 1:4:xtic(1) \
|
47
|
+
title "No keep-alive" \
|
48
|
+
linestyle 1 \
|
49
|
+
with lines, \
|
50
|
+
"throughput.data" using 1:5:xtic(1) \
|
51
|
+
title "With keep-alive" \
|
52
|
+
linestyle 4 \
|
53
|
+
with lines
|
metadata
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rabbit-slide-kou-nginx-tech-talks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2016.2.8.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kouhei Sutou
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rabbit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rabbit-theme-groonga
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: nginxに全文検索エンジンGroongaを組み込んでnginxを全文検索サーバーにするngx_http_groongaを紹介します。
|
42
|
+
email:
|
43
|
+
- kou@clear-code.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".rabbit"
|
49
|
+
- README.rd
|
50
|
+
- Rakefile
|
51
|
+
- config.yaml
|
52
|
+
- images/groonga-icon-full-size.svg
|
53
|
+
- images/groonga-logo.svg
|
54
|
+
- images/ngx_http_groonga.svg
|
55
|
+
- images/register.svg
|
56
|
+
- images/search.svg
|
57
|
+
- ngx-http-groonga.rab
|
58
|
+
- pdf/nginx-tech-talks-ngx-http-groonga.pdf
|
59
|
+
- theme.rb
|
60
|
+
- throughput-no-keep-alive.pdf
|
61
|
+
- throughput-with-keep-alive.pdf
|
62
|
+
- throughput.data
|
63
|
+
- throughput.gnuplot
|
64
|
+
homepage: http://slide.rabbit-shocker.org/authors/kou/nginx-tech-talks/
|
65
|
+
licenses:
|
66
|
+
- CC BY 3.0
|
67
|
+
- CC BY-SA 4.0
|
68
|
+
metadata: {}
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options: []
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
requirements: []
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 2.4.5.1
|
86
|
+
signing_key:
|
87
|
+
specification_version: 4
|
88
|
+
summary: ngx_http_groonga - 全文検索nginx
|
89
|
+
test_files: []
|