SlideShare a Scribd company logo
1 of 21
Download to read offline
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
ngx_http_groonga
全文検索nginx
須藤功平 クリアコード
nginx Tech Talks
2016-02-08
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
nginx
HTTPサーバー
HTTPリバースプロキシサーバー
メールプロキシサーバー
TCPプロキシサーバー
1.9.0から。まだmainline。
nginx = いろいろできるサーバー
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
全文検索nginx
HTTPサーバー
HTTPリバースプロキシサーバー
メールプロキシサーバー
TCPプロキシサーバー
[New!]全文検索エンジン!
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
使い方:登録
全文検索
NGINX
登録
HTTP
POST
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
使い方:検索
全文検索
NGINX
HTTP GET
?query=nginx
検索
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
速度:1リクエスト
対象:Wikipedia日本語版
レコード数:約185万件
データサイズ:約7GB
検索キーワード:nginx
0.6msIntel Core i7-6700 3.40GHz
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
速度:スループット
0
2000
4000
6000
8000
10000
12000
14000
1 2 3 4 5 6 7 8 16 32
N CPUs = 8
requests/sec
N connections
1 worker 4 workers 8 workers
ワーカー数を増やすとCPUコア数までスケール
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
速度:スループット
0
2000
4000
6000
8000
10000
12000
14000
1 2 3 4 5 6 7 8 16 32
N workers = 8 (= N CPUs)
requests/sec
N connections
No keep-alive With keep-alive
クライアントがkeep-aliveを使うとさらにスケール
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
速度
1リクエストの処理も速い
スループットも出る
ワーカー数を増やすとスケール
keep-aliveでさらにスケール
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
速さの理由
本物の全文検索エンジンを組込
→1リクエストの処理が速い
(しかも豊富な機能)
それもnginxのよさを殺さずに
例:マルチプロセスでスケール
例:性能向上用のHTTPの機能を利用
(keep-alive、レスポンス圧縮など)
例:I/O多重化(同時接続数の増加に対応)
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
本物の全文検索エンジン
(ぐるんが)
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
Groonga
速い
日本語に強い(国産)
ライブラリーとして使える
組み込みやすい
マルチプロセス対応
複数のプロセスで同時にDBを使える
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
組込方法
モジュール
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
ngx_http_groonga
全文検索
NGINX
ngx_http_groonga
HTTP,I/O,TLS,...
HTTP
普通の
nginx
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
Groongaから見たメリット
nginxと連携すると…
プロセス管理を任せられる
クライアントとのI/Oを任せられる
keep-alive・認証・TLS・圧縮対応
HTTP2対応(まだmainline)
全文検索に集中できる!
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
困ったこと
nginxのWindows用バイナリーを
GNU/Linux上でビルドできない
Groongaはバイナリーを配布したい
Windowsが必要だとリリース作業が
ツライ
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
対策
パッチを送る
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
結果
取り込まれた(1.7.7 released at 2014-10-28)
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
パッチが取り込まれるまで
hgでパッチを作る
メーリングリストに送る
やりとりする
取り込まれる
結構反応してくれるから
なにかあったら送るといいよ!
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
全文検索nginx
nginx + Groonga
= groonga-httpd:Groongaパッケージに含まれている
nginxが全文検索エンジンに!
nginxのモジュール機能で実装
モジュールを作って
nginxと共存しよう!
ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9
お知らせ
MySQL・PostgreSQLとも共存
Groongaは肉の日リリース
2月9日にイベントあります!
MySQLとPostgreSQLと
日本語全文検索
(DMM.comラボにて)

More Related Content

What's hot

初心者向けMroonga・PGroonga情報
初心者向けMroonga・PGroonga情報初心者向けMroonga・PGroonga情報
初心者向けMroonga・PGroonga情報Kouhei Sutou
 
MroongaとPGroonga
MroongaとPGroongaMroongaとPGroonga
MroongaとPGroongaKouhei Sutou
 
【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」
【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」
【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」Developers Summit
 
Introduction to Ostinato , network packet crafting and generator.
Introduction to Ostinato, network packet crafting and generator.Introduction to Ostinato, network packet crafting and generator.
Introduction to Ostinato , network packet crafting and generator.Kentaro Ebisawa
 
Polidog に RPM の作り方を教える
Polidog に RPM の作り方を教えるPolidog に RPM の作り方を教える
Polidog に RPM の作り方を教えるftnk
 
イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化Gosuke Miyashita
 
lua_nginx_module JSON-RPC 2.0 Batch Request
lua_nginx_module JSON-RPC 2.0 Batch Requestlua_nginx_module JSON-RPC 2.0 Batch Request
lua_nginx_module JSON-RPC 2.0 Batch Requestmosa siru
 
Webアプリケーションの無停止稼働
Webアプリケーションの無停止稼働Webアプリケーションの無停止稼働
Webアプリケーションの無停止稼働Kazuho Oku
 
Sohu邮箱的python经验
Sohu邮箱的python经验Sohu邮箱的python经验
Sohu邮箱的python经验Ryan Poy
 
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くしたNginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くしたtoshi_pp
 
Capistranoで自動デプロイ
Capistranoで自動デプロイCapistranoで自動デプロイ
Capistranoで自動デプロイtoyoshi
 
OpenShift from Easy way to Hard ? Way
OpenShift from Easy way to Hard ? WayOpenShift from Easy way to Hard ? Way
OpenShift from Easy way to Hard ? Wayロフト くん
 
Lagopus performance
Lagopus performanceLagopus performance
Lagopus performanceMasaru Oki
 
Fluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent BitFluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent BitSeiya Mizuno
 
Lagopusとvagrant
LagopusとvagrantLagopusとvagrant
LagopusとvagrantMasaru Oki
 
Lagopus as open flow hybrid switch 実践編
Lagopus as open flow hybrid switch 実践編Lagopus as open flow hybrid switch 実践編
Lagopus as open flow hybrid switch 実践編Masaru Oki
 
Lagopus, raw socket build
Lagopus, raw socket buildLagopus, raw socket build
Lagopus, raw socket buildMasaru Oki
 

What's hot (20)

初心者向けMroonga・PGroonga情報
初心者向けMroonga・PGroonga情報初心者向けMroonga・PGroonga情報
初心者向けMroonga・PGroonga情報
 
MroongaとPGroonga
MroongaとPGroongaMroongaとPGroonga
MroongaとPGroonga
 
【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」
【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」
【19-C-L】Web開発者ならおさえておきたい「常時SSL/TLS化の実装ポイント」
 
Namespace
NamespaceNamespace
Namespace
 
Introduction to Ostinato , network packet crafting and generator.
Introduction to Ostinato, network packet crafting and generator.Introduction to Ostinato, network packet crafting and generator.
Introduction to Ostinato , network packet crafting and generator.
 
Polidog に RPM の作り方を教える
Polidog に RPM の作り方を教えるPolidog に RPM の作り方を教える
Polidog に RPM の作り方を教える
 
イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化
 
lua_nginx_module JSON-RPC 2.0 Batch Request
lua_nginx_module JSON-RPC 2.0 Batch Requestlua_nginx_module JSON-RPC 2.0 Batch Request
lua_nginx_module JSON-RPC 2.0 Batch Request
 
Webアプリケーションの無停止稼働
Webアプリケーションの無停止稼働Webアプリケーションの無停止稼働
Webアプリケーションの無停止稼働
 
Sohu邮箱的python经验
Sohu邮箱的python经验Sohu邮箱的python经验
Sohu邮箱的python经验
 
Lagopus 0.2.2
Lagopus 0.2.2Lagopus 0.2.2
Lagopus 0.2.2
 
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くしたNginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
 
Capistranoで自動デプロイ
Capistranoで自動デプロイCapistranoで自動デプロイ
Capistranoで自動デプロイ
 
OpenShift from Easy way to Hard ? Way
OpenShift from Easy way to Hard ? WayOpenShift from Easy way to Hard ? Way
OpenShift from Easy way to Hard ? Way
 
Lagopus performance
Lagopus performanceLagopus performance
Lagopus performance
 
Fluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent BitFluentd1.2 & Fluent Bit
Fluentd1.2 & Fluent Bit
 
Lagopusとvagrant
LagopusとvagrantLagopusとvagrant
Lagopusとvagrant
 
Monit
MonitMonit
Monit
 
Lagopus as open flow hybrid switch 実践編
Lagopus as open flow hybrid switch 実践編Lagopus as open flow hybrid switch 実践編
Lagopus as open flow hybrid switch 実践編
 
Lagopus, raw socket build
Lagopus, raw socket buildLagopus, raw socket build
Lagopus, raw socket build
 

Similar to ngx_http_groonga - 全文検索nginx

NGINX製品の最新機能アップデート情報
NGINX製品の最新機能アップデート情報NGINX製品の最新機能アップデート情報
NGINX製品の最新機能アップデート情報NGINX, Inc.
 
NGINX + Ansible Automation Webinar (日本語版)
NGINX + Ansible Automation Webinar (日本語版)NGINX + Ansible Automation Webinar (日本語版)
NGINX + Ansible Automation Webinar (日本語版)NGINX, Inc.
 
Nginx バージョンアップ動向(2015/07〜2015/12)
Nginx バージョンアップ動向(2015/07〜2015/12)Nginx バージョンアップ動向(2015/07〜2015/12)
Nginx バージョンアップ動向(2015/07〜2015/12)Narimichi Takamura
 
2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料
2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料
2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料Yasutaka Hamada
 
NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)NGINX, Inc.
 
Webサーバ勉強会#4
Webサーバ勉強会#4Webサーバ勉強会#4
Webサーバ勉強会#4oranie Narut
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP betterKazuho Oku
 
Word press on conoha このべん #3
Word press on conoha このべん #3Word press on conoha このべん #3
Word press on conoha このべん #3Wataru OKAMOTO
 
ネットワークエンジニアのための Puppet / Chef
ネットワークエンジニアのための Puppet / Chefネットワークエンジニアのための Puppet / Chef
ネットワークエンジニアのための Puppet / Chefnpsg
 
軽量高機能webサーバーnginx
軽量高機能webサーバーnginx軽量高機能webサーバーnginx
軽量高機能webサーバーnginxngi group.
 
ゲームのインフラをAwsで実戦tips全て見せます
ゲームのインフラをAwsで実戦tips全て見せますゲームのインフラをAwsで実戦tips全て見せます
ゲームのインフラをAwsで実戦tips全て見せますinfinite_loop
 
JOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API Dragon
JOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API DragonJOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API Dragon
JOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API DragonNaoto Gohko
 
20120821 pronet study
20120821 pronet study20120821 pronet study
20120821 pronet studySix Apart
 
テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-
テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-
テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-賢 秋穂
 
EchoyaGinhanazeSu_inoka.pptx
EchoyaGinhanazeSu_inoka.pptxEchoyaGinhanazeSu_inoka.pptx
EchoyaGinhanazeSu_inoka.pptxkeink
 
Openshift NGINX Kubernetes (Japanese Webinar)
Openshift NGINX Kubernetes (Japanese Webinar)Openshift NGINX Kubernetes (Japanese Webinar)
Openshift NGINX Kubernetes (Japanese Webinar)NGINX, Inc.
 

Similar to ngx_http_groonga - 全文検索nginx (20)

NGINX製品の最新機能アップデート情報
NGINX製品の最新機能アップデート情報NGINX製品の最新機能アップデート情報
NGINX製品の最新機能アップデート情報
 
NGINX + Ansible Automation Webinar (日本語版)
NGINX + Ansible Automation Webinar (日本語版)NGINX + Ansible Automation Webinar (日本語版)
NGINX + Ansible Automation Webinar (日本語版)
 
nginx入門
nginx入門nginx入門
nginx入門
 
Nginx バージョンアップ動向(2015/07〜2015/12)
Nginx バージョンアップ動向(2015/07〜2015/12)Nginx バージョンアップ動向(2015/07〜2015/12)
Nginx バージョンアップ動向(2015/07〜2015/12)
 
2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料
2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料
2014/11/04 第2回 一撃サーバー構築シェルスクリプト勉強会(さっぽろ!) 発表資料
 
Ad stirの裏側
Ad stirの裏側Ad stirの裏側
Ad stirの裏側
 
NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)NGINX Back to Basics: Ingress Controller (Japanese Webinar)
NGINX Back to Basics: Ingress Controller (Japanese Webinar)
 
PGroongaの実装
PGroongaの実装PGroongaの実装
PGroongaの実装
 
Webサーバ勉強会#4
Webサーバ勉強会#4Webサーバ勉強会#4
Webサーバ勉強会#4
 
nginxの紹介
nginxの紹介nginxの紹介
nginxの紹介
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP better
 
Word press on conoha このべん #3
Word press on conoha このべん #3Word press on conoha このべん #3
Word press on conoha このべん #3
 
ネットワークエンジニアのための Puppet / Chef
ネットワークエンジニアのための Puppet / Chefネットワークエンジニアのための Puppet / Chef
ネットワークエンジニアのための Puppet / Chef
 
軽量高機能webサーバーnginx
軽量高機能webサーバーnginx軽量高機能webサーバーnginx
軽量高機能webサーバーnginx
 
ゲームのインフラをAwsで実戦tips全て見せます
ゲームのインフラをAwsで実戦tips全て見せますゲームのインフラをAwsで実戦tips全て見せます
ゲームのインフラをAwsで実戦tips全て見せます
 
JOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API Dragon
JOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API DragonJOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API Dragon
JOSUG2014 OpenStack 4th birthday party in Japan; the way of OpenStack API Dragon
 
20120821 pronet study
20120821 pronet study20120821 pronet study
20120821 pronet study
 
テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-
テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-
テスト駆動インフラ構築-Chefとserverspecを使ったインフラ自動化のすすめ-
 
EchoyaGinhanazeSu_inoka.pptx
EchoyaGinhanazeSu_inoka.pptxEchoyaGinhanazeSu_inoka.pptx
EchoyaGinhanazeSu_inoka.pptx
 
Openshift NGINX Kubernetes (Japanese Webinar)
Openshift NGINX Kubernetes (Japanese Webinar)Openshift NGINX Kubernetes (Japanese Webinar)
Openshift NGINX Kubernetes (Japanese Webinar)
 

More from Kouhei Sutou

RubyKaigi 2022 - Fast data processing with Ruby and Apache Arrow
RubyKaigi 2022 - Fast data processing with Ruby and Apache ArrowRubyKaigi 2022 - Fast data processing with Ruby and Apache Arrow
RubyKaigi 2022 - Fast data processing with Ruby and Apache ArrowKouhei Sutou
 
Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021
Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021
Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021Kouhei Sutou
 
RubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache Arrow
RubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache ArrowRubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache Arrow
RubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache ArrowKouhei Sutou
 
Rubyと仕事と自由なソフトウェア
Rubyと仕事と自由なソフトウェアRubyと仕事と自由なソフトウェア
Rubyと仕事と自由なソフトウェアKouhei Sutou
 
Apache Arrowフォーマットはなぜ速いのか
Apache Arrowフォーマットはなぜ速いのかApache Arrowフォーマットはなぜ速いのか
Apache Arrowフォーマットはなぜ速いのかKouhei Sutou
 
Apache Arrow 1.0 - A cross-language development platform for in-memory data
Apache Arrow 1.0 - A cross-language development platform for in-memory dataApache Arrow 1.0 - A cross-language development platform for in-memory data
Apache Arrow 1.0 - A cross-language development platform for in-memory dataKouhei Sutou
 
Redmine検索の未来像
Redmine検索の未来像Redmine検索の未来像
Redmine検索の未来像Kouhei Sutou
 
Apache Arrow - A cross-language development platform for in-memory data
Apache Arrow - A cross-language development platform for in-memory dataApache Arrow - A cross-language development platform for in-memory data
Apache Arrow - A cross-language development platform for in-memory dataKouhei Sutou
 
Better CSV processing with Ruby 2.6
Better CSV processing with Ruby 2.6Better CSV processing with Ruby 2.6
Better CSV processing with Ruby 2.6Kouhei Sutou
 
Apache Arrow - データ処理ツールの次世代プラットフォーム
Apache Arrow - データ処理ツールの次世代プラットフォームApache Arrow - データ処理ツールの次世代プラットフォーム
Apache Arrow - データ処理ツールの次世代プラットフォームKouhei Sutou
 
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システムMySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システムKouhei Sutou
 
MySQL 8.0でMroonga
MySQL 8.0でMroongaMySQL 8.0でMroonga
MySQL 8.0でMroongaKouhei Sutou
 
Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!
Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!
Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!Kouhei Sutou
 
MariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システムMariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システムKouhei Sutou
 
PGroonga 2 – Make PostgreSQL rich full text search system backend!
PGroonga 2 – Make PostgreSQL rich full text search system backend!PGroonga 2 – Make PostgreSQL rich full text search system backend!
PGroonga 2 – Make PostgreSQL rich full text search system backend!Kouhei Sutou
 

More from Kouhei Sutou (20)

RubyKaigi 2022 - Fast data processing with Ruby and Apache Arrow
RubyKaigi 2022 - Fast data processing with Ruby and Apache ArrowRubyKaigi 2022 - Fast data processing with Ruby and Apache Arrow
RubyKaigi 2022 - Fast data processing with Ruby and Apache Arrow
 
Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021
Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021
Apache Arrow Flight – ビッグデータ用高速データ転送フレームワーク #dbts2021
 
RubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache Arrow
RubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache ArrowRubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache Arrow
RubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache Arrow
 
Rubyと仕事と自由なソフトウェア
Rubyと仕事と自由なソフトウェアRubyと仕事と自由なソフトウェア
Rubyと仕事と自由なソフトウェア
 
Apache Arrowフォーマットはなぜ速いのか
Apache Arrowフォーマットはなぜ速いのかApache Arrowフォーマットはなぜ速いのか
Apache Arrowフォーマットはなぜ速いのか
 
Apache Arrow 1.0 - A cross-language development platform for in-memory data
Apache Arrow 1.0 - A cross-language development platform for in-memory dataApache Arrow 1.0 - A cross-language development platform for in-memory data
Apache Arrow 1.0 - A cross-language development platform for in-memory data
 
Apache Arrow 2019
Apache Arrow 2019Apache Arrow 2019
Apache Arrow 2019
 
Redmine検索の未来像
Redmine検索の未来像Redmine検索の未来像
Redmine検索の未来像
 
Apache Arrow - A cross-language development platform for in-memory data
Apache Arrow - A cross-language development platform for in-memory dataApache Arrow - A cross-language development platform for in-memory data
Apache Arrow - A cross-language development platform for in-memory data
 
Better CSV processing with Ruby 2.6
Better CSV processing with Ruby 2.6Better CSV processing with Ruby 2.6
Better CSV processing with Ruby 2.6
 
Apache Arrow
Apache ArrowApache Arrow
Apache Arrow
 
Apache Arrow - データ処理ツールの次世代プラットフォーム
Apache Arrow - データ処理ツールの次世代プラットフォームApache Arrow - データ処理ツールの次世代プラットフォーム
Apache Arrow - データ処理ツールの次世代プラットフォーム
 
Apache Arrow
Apache ArrowApache Arrow
Apache Arrow
 
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システムMySQL・PostgreSQLだけで作る高速あいまい全文検索システム
MySQL・PostgreSQLだけで作る高速あいまい全文検索システム
 
MySQL 8.0でMroonga
MySQL 8.0でMroongaMySQL 8.0でMroonga
MySQL 8.0でMroonga
 
My way with Ruby
My way with RubyMy way with Ruby
My way with Ruby
 
Red Data Tools
Red Data ToolsRed Data Tools
Red Data Tools
 
Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!
Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!
Mroongaの高速全文検索機能でWordPress内のコンテンツを有効活用!
 
MariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システムMariaDBとMroongaで作る全言語対応超高速全文検索システム
MariaDBとMroongaで作る全言語対応超高速全文検索システム
 
PGroonga 2 – Make PostgreSQL rich full text search system backend!
PGroonga 2 – Make PostgreSQL rich full text search system backend!PGroonga 2 – Make PostgreSQL rich full text search system backend!
PGroonga 2 – Make PostgreSQL rich full text search system backend!
 

ngx_http_groonga - 全文検索nginx

  • 1. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 ngx_http_groonga 全文検索nginx 須藤功平 クリアコード nginx Tech Talks 2016-02-08
  • 2. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 nginx HTTPサーバー HTTPリバースプロキシサーバー メールプロキシサーバー TCPプロキシサーバー 1.9.0から。まだmainline。 nginx = いろいろできるサーバー
  • 3. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 全文検索nginx HTTPサーバー HTTPリバースプロキシサーバー メールプロキシサーバー TCPプロキシサーバー [New!]全文検索エンジン!
  • 4. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 使い方:登録 全文検索 NGINX 登録 HTTP POST
  • 5. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 使い方:検索 全文検索 NGINX HTTP GET ?query=nginx 検索
  • 6. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 速度:1リクエスト 対象:Wikipedia日本語版 レコード数:約185万件 データサイズ:約7GB 検索キーワード:nginx 0.6msIntel Core i7-6700 3.40GHz
  • 7. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 速度:スループット 0 2000 4000 6000 8000 10000 12000 14000 1 2 3 4 5 6 7 8 16 32 N CPUs = 8 requests/sec N connections 1 worker 4 workers 8 workers ワーカー数を増やすとCPUコア数までスケール
  • 8. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 速度:スループット 0 2000 4000 6000 8000 10000 12000 14000 1 2 3 4 5 6 7 8 16 32 N workers = 8 (= N CPUs) requests/sec N connections No keep-alive With keep-alive クライアントがkeep-aliveを使うとさらにスケール
  • 9. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 速度 1リクエストの処理も速い スループットも出る ワーカー数を増やすとスケール keep-aliveでさらにスケール
  • 10. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 速さの理由 本物の全文検索エンジンを組込 →1リクエストの処理が速い (しかも豊富な機能) それもnginxのよさを殺さずに 例:マルチプロセスでスケール 例:性能向上用のHTTPの機能を利用 (keep-alive、レスポンス圧縮など) 例:I/O多重化(同時接続数の増加に対応)
  • 11. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 本物の全文検索エンジン (ぐるんが)
  • 12. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 Groonga 速い 日本語に強い(国産) ライブラリーとして使える 組み込みやすい マルチプロセス対応 複数のプロセスで同時にDBを使える
  • 13. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 組込方法 モジュール
  • 14. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 ngx_http_groonga 全文検索 NGINX ngx_http_groonga HTTP,I/O,TLS,... HTTP 普通の nginx
  • 15. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 Groongaから見たメリット nginxと連携すると… プロセス管理を任せられる クライアントとのI/Oを任せられる keep-alive・認証・TLS・圧縮対応 HTTP2対応(まだmainline) 全文検索に集中できる!
  • 16. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 困ったこと nginxのWindows用バイナリーを GNU/Linux上でビルドできない Groongaはバイナリーを配布したい Windowsが必要だとリリース作業が ツライ
  • 17. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 対策 パッチを送る
  • 18. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 結果 取り込まれた(1.7.7 released at 2014-10-28)
  • 19. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 パッチが取り込まれるまで hgでパッチを作る メーリングリストに送る やりとりする 取り込まれる 結構反応してくれるから なにかあったら送るといいよ!
  • 20. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 全文検索nginx nginx + Groonga = groonga-httpd:Groongaパッケージに含まれている nginxが全文検索エンジンに! nginxのモジュール機能で実装 モジュールを作って nginxと共存しよう!
  • 21. ngx_http_groonga 全文検索nginx Powered by Rabbit 2.1.9 お知らせ MySQL・PostgreSQLとも共存 Groongaは肉の日リリース 2月9日にイベントあります! MySQLとPostgreSQLと 日本語全文検索 (DMM.comラボにて)