Debian Codegraph @

doc/locale/en/html/server/http/comparison.html

raw symbols SCIP
1
2 <!DOCTYPE html>
3
4
5 <html lang="en" data-content_root="../../" >
6
7 <head>
8 <meta charset="utf-8" />
9 <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
10
11 <title>5.2.1. Comparison &#8212; Groonga v16.0.9 documentation</title>
12
13
14
15 <script data-cfasync="false">
16 document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
17 document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
18 </script>
19 <!--
20 this give us a css class that will be invisible only if js is disabled
21 -->
22 <noscript>
23 <style>
24 .pst-js-only { display: none !important; }
25
26 </style>
27 </noscript>
28
29 <!-- Loaded before other Sphinx assets -->
30 <link href="../../_static/styles/theme.css?digest=90905a2f556bf617f1a9" rel="stylesheet" />
31 <link href="../../_static/styles/pydata-sphinx-theme.css?digest=90905a2f556bf617f1a9" rel="stylesheet" />
32
33 <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=8f2a1f02" />
34
35 <!-- So that users can add custom icons -->
36 <script defer src="../../_static/scripts/fontawesome.js?digest=90905a2f556bf617f1a9"></script>
37 <!-- Pre-loaded scripts that we'll load fully later -->
38 <link rel="preload" as="script" href="../../_static/scripts/bootstrap.js?digest=90905a2f556bf617f1a9" />
39 <link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=90905a2f556bf617f1a9" />
40
41 <script src="../../_static/documentation_options.js?v=2fcb8d4f"></script>
42 <script src="../../_static/doctools.js?v=fd6eb6e6"></script>
43 <script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script>
44 <script>
45 window.dataLayer = window.dataLayer || [];
46 function gtag(){ dataLayer.push(arguments); }
47 gtag('consent', 'default', {
48 'ad_storage': 'denied',
49 'ad_user_data': 'denied',
50 'ad_personalization': 'denied',
51 'analytics_storage': 'denied'
52 });
53 </script>
54 <script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-MDK38RHNPW"></script>
55 <script>
56 window.dataLayer = window.dataLayer || [];
57 function gtag(){dataLayer.push(arguments);}
58 gtag('js', new Date());
59 gtag('config', 'G-MDK38RHNPW');
60 </script>
61 <script>DOCUMENTATION_OPTIONS.pagename = 'server/http/comparison';</script>
62 <script>
63 DOCUMENTATION_OPTIONS.theme_version = '0.20.0';
64 DOCUMENTATION_OPTIONS.theme_switcher_json_url = 'https://groonga.org/docs/_static/switcher.json';
65 DOCUMENTATION_OPTIONS.theme_switcher_version_match = 'english';
66 DOCUMENTATION_OPTIONS.show_version_warning_banner =
67 false;
68 </script>
69 <script>DOCUMENTATION_OPTIONS.search_as_you_type = false;</script>
70 <link rel="icon" href="../../_static/favicon.ico"/>
71 <link rel="index" title="Index" href="../../genindex.html" />
72 <link rel="search" title="Search" href="../../search.html" />
73 <link rel="next" title="5.2.2. groonga" href="groonga.html" />
74 <link rel="prev" title="5.2. HTTP" href="../http.html" />
75 <meta name="viewport" content="width=device-width, initial-scale=1"/>
76 <meta name="docsearch:language" content="en"/>
77 <meta name="docsearch:version" content="16.0.9" />
78
79
80 <script src="../../_static/searchtools.js"></script>
81 <script src="../../_static/language_data.js"></script>
82 <script src="../../searchindex.js"></script>
83
84 </head>
85 <body data-default-mode="">
86
87
88 <div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
89
90
91 <div id="pst-scroll-pixel-helper"></div>
92
93 <button type="button" class="btn rounded-pill" id="pst-back-to-top">
94 <i class="fa-solid fa-arrow-up"></i>Back to top</button>
95
96
97
98
99 <dialog id="pst-search-dialog">
100
101 <form class="bd-search d-flex align-items-center"
102 action="../../search.html"
103 method="get">
104 <i class="fa-solid fa-magnifying-glass"></i>
105 <input type="search"
106 class="form-control"
107 name="q"
108 placeholder="Search the docs ..."
109 aria-label="Search the docs ..."
110 autocomplete="off"
111 autocorrect="off"
112 autocapitalize="off"
113 spellcheck="false"/>
114 <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
115 </form>
116 </dialog>
117
118 <div class="pst-async-banner-revealer d-none">
119 <aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
120 </div>
121
122
123 <header id="pst-header" class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
124 <div class="bd-header__inner bd-page-width">
125 <button class="pst-navbar-icon sidebar-toggle primary-toggle" aria-label="Site navigation">
126 <span class="fa-solid fa-bars"></span>
127 </button>
128
129
130 <div class="col-lg-3 navbar-header-items__start">
131
132 <div class="navbar-item">
133
134
135
136
137
138 <a class="navbar-brand logo" href="https://groonga.org/">
139
140
141
142
143
144
145
146
147
148
149 <img src="../../_static/groonga.png" class="logo__image only-light" alt="Groonga v16.0.9 documentation - Home"/>
150 <img src="../../_static/groonga.png" class="logo__image only-dark pst-js-only" alt="Groonga v16.0.9 documentation - Home"/>
151
152
153 </a></div>
154
155 </div>
156
157 <div class="col-lg-9 navbar-header-items">
158
159
160 <div class="navbar-header-items__end">
161
162 <div class="navbar-item navbar-persistent--container">
163
164
165 <button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
166 <i class="fa-solid fa-magnifying-glass"></i>
167 <span class="search-button__default-text">Search</span>
168 <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
169 </button>
170 </div>
171
172
173 <div class="navbar-item">
174
175 <div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode">
176 <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown">
177 <i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="Light"></i>
178 <i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="Dark"></i>
179 <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i>
180 </button>
181 <ul class="dropdown-menu dropdown-menu-end">
182 <li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li>
183 <li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>Light</button></li>
184 <li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>Dark</button></li>
185 </ul>
186 </div></div>
187
188 <div class="navbar-item"><ul class="navbar-icon-links"
189 aria-label="Icon Links">
190 <li class="nav-item">
191
192
193
194
195
196
197
198
199 <a href="https://github.com/groonga/groonga" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a>
200 </li>
201 <li class="nav-item">
202
203
204
205
206
207
208
209
210 <a href="https://twitter.com/groonga" title="Twitter" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-twitter fa-lg" aria-hidden="true"></i><span class="visually-hidden">Twitter</span></a>
211 </li>
212 <li class="nav-item">
213
214
215
216
217
218
219
220
221 <a href="/blog" title="Blog" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fas fa-blog fa-lg" aria-hidden="true"></i><span class="visually-hidden">Blog</span></a>
222 </li>
223 </ul></div>
224
225 <div class="navbar-item">
226 <div class="version-switcher__container dropdown pst-js-only">
227 <button id="pst-version-switcher-button-2"
228 type="button"
229 class="version-switcher__button btn btn-sm dropdown-toggle"
230 data-bs-toggle="dropdown"
231 aria-haspopup="listbox"
232 aria-controls="pst-version-switcher-list-2"
233 aria-label="Version switcher list"
234 >
235 Choose version <!-- this text may get changed later by javascript -->
236 <span class="caret"></span>
237 </button>
238 <div id="pst-version-switcher-list-2"
239 class="version-switcher__menu dropdown-menu list-group-flush py-0"
240 role="listbox" aria-labelledby="pst-version-switcher-button-2">
241 <!-- dropdown will be populated by javascript on page load -->
242 </div>
243 </div></div>
244
245 </div>
246
247 </div>
248
249
250 <div class="navbar-persistent--mobile">
251
252 <button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
253 <i class="fa-solid fa-magnifying-glass"></i>
254 <span class="search-button__default-text">Search</span>
255 <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
256 </button>
257 </div>
258
259
260
261 <button class="pst-navbar-icon sidebar-toggle secondary-toggle" aria-label="On this page">
262 <span class="fa-solid fa-outdent"></span>
263 </button>
264
265 </div>
266
267 </header>
268
269
270 <div class="bd-container">
271 <div class="bd-container__inner bd-page-width">
272
273
274
275 <dialog id="pst-primary-sidebar-modal"></dialog>
276 <div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar">
277
278
279
280 <div class="sidebar-header-items sidebar-primary__section">
281
282
283
284
285 <div class="sidebar-header-items__end">
286
287 <div class="navbar-item">
288
289 <div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode">
290 <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown">
291 <i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="Light"></i>
292 <i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="Dark"></i>
293 <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i>
294 </button>
295 <ul class="dropdown-menu dropdown-menu-end">
296 <li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li>
297 <li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>Light</button></li>
298 <li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>Dark</button></li>
299 </ul>
300 </div></div>
301
302 <div class="navbar-item"><ul class="navbar-icon-links"
303 aria-label="Icon Links">
304 <li class="nav-item">
305
306
307
308
309
310
311
312
313 <a href="https://github.com/groonga/groonga" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a>
314 </li>
315 <li class="nav-item">
316
317
318
319
320
321
322
323
324 <a href="https://twitter.com/groonga" title="Twitter" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-twitter fa-lg" aria-hidden="true"></i><span class="visually-hidden">Twitter</span></a>
325 </li>
326 <li class="nav-item">
327
328
329
330
331
332
333
334
335 <a href="/blog" title="Blog" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fas fa-blog fa-lg" aria-hidden="true"></i><span class="visually-hidden">Blog</span></a>
336 </li>
337 </ul></div>
338
339 <div class="navbar-item">
340 <div class="version-switcher__container dropdown pst-js-only">
341 <button id="pst-version-switcher-button-3"
342 type="button"
343 class="version-switcher__button btn btn-sm dropdown-toggle"
344 data-bs-toggle="dropdown"
345 aria-haspopup="listbox"
346 aria-controls="pst-version-switcher-list-3"
347 aria-label="Version switcher list"
348 >
349 Choose version <!-- this text may get changed later by javascript -->
350 <span class="caret"></span>
351 </button>
352 <div id="pst-version-switcher-list-3"
353 class="version-switcher__menu dropdown-menu list-group-flush py-0"
354 role="listbox" aria-labelledby="pst-version-switcher-button-3">
355 <!-- dropdown will be populated by javascript on page load -->
356 </div>
357 </div></div>
358
359 </div>
360
361 </div>
362
363 <div class="sidebar-primary-items__start sidebar-primary__section">
364 <div class="sidebar-primary-item pst-sidebar-collapse"><button id="pst-collapse-sidebar-button" aria-expanded="true" aria-controls="pst-primary-sidebar">
365 <svg class="pst-icon" role="img" aria-hidden="true" focusable="false" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
366 <path fill="currentColor" d="M3 15.5C2.36232 15.5 1.74874 15.2564 1.28478 14.8189C0.820828 14.3815 0.541576 13.7832 0.504167 13.1467L0.5 13L0.5 3C0.499965 2.36232 0.743605 1.74874 1.18107 1.28478C1.61854 0.820828 2.21676 0.541576 2.85333 0.504167L3 0.5L13 0.5C13.6377 0.499965 14.2513 0.743605 14.7152 1.18107C15.1792 1.61854 15.4584 2.21676 15.4958 2.85333L15.5 3L15.5 13C15.5 13.6377 15.2564 14.2513 14.8189 14.7152C14.3815 15.1792 13.7832 15.4584 13.1467 15.4958L13 15.5L3 15.5ZM3 13.8333L10.5 13.8333L10.5 2.16667L3 2.16667C2.79589 2.16669 2.59889 2.24163 2.44636 2.37726C2.29383 2.5129 2.19638 2.69979 2.1725 2.9025L2.16667 3L2.16667 13C2.16669 13.2041 2.24163 13.4011 2.37726 13.5536C2.5129 13.7062 2.69979 13.8036 2.9025 13.8275L3 13.8333ZM6.65583 10.325L6.5775 10.2558L4.91083 8.58917C4.76735 8.44567 4.68116 8.25476 4.66843 8.05223C4.65569 7.84971 4.71729 7.6495 4.84167 7.48917L4.91083 7.41083L6.5775 5.74417C6.72747 5.59471 6.9287 5.50794 7.14032 5.50148C7.35194 5.49502 7.55809 5.56935 7.7169 5.70937C7.8757 5.8494 7.97525 6.04463 7.99533 6.25539C8.01541 6.46616 7.95451 6.67667 7.825 6.84417L7.75583 6.9225L6.67917 8L7.75583 9.0775C7.89931 9.22099 7.98551 9.41191 7.99824 9.61443C8.01097 9.81695 7.94938 10.0172 7.825 10.1775L7.75583 10.2558C7.61234 10.3993 7.42142 10.4855 7.2189 10.4982C7.01638 10.511 6.81617 10.4494 6.65583 10.325Z"/>
367 </svg>
368 <span class="pst-collapse-sidebar-label">Collapse Sidebar</span>
369 <span class="pst-expand-sidebar-label">Expand Sidebar</span>
370 </button></div>
371 <div class="sidebar-primary-item">
372
373 <nav class="bd-docs-nav bd-links"
374 aria-label="Section Navigation">
375 <p class="bd-links__title" role="heading" aria-level="1">Section Navigation</p>
376 <div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav">
377 <li class="toctree-l1"><a class="reference internal" href="../package.html">5.1. Server packages</a></li>
378 <li class="toctree-l1 current active has-children"><a class="reference internal" href="../http.html">5.2. HTTP</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul class="current">
379 <li class="toctree-l2 current active"><a class="current reference internal" href="#">5.2.1. Comparison</a></li>
380 <li class="toctree-l2"><a class="reference internal" href="groonga.html">5.2.2. groonga</a></li>
381 <li class="toctree-l2"><a class="reference internal" href="groonga-httpd.html">5.2.3. groonga-httpd</a></li>
382 </ul>
383 </details></li>
384 <li class="toctree-l1"><a class="reference internal" href="../gqtp.html">5.3. GQTP</a></li>
385 <li class="toctree-l1"><a class="reference internal" href="../memcached.html">5.4. Memcached binary protocol</a></li>
386 </ul>
387 </div>
388 </nav></div>
389 </div>
390
391
392 <div class="sidebar-primary-items__end sidebar-primary__section">
393 <div class="sidebar-primary-item">
394 <div id="ethical-ad-placement"
395 class="flat"
396 data-ea-publisher="readthedocs"
397 data-ea-type="readthedocs-sidebar"
398 data-ea-manual="true">
399 </div></div>
400 </div>
401
402
403 </div>
404
405 <main id="main-content" class="bd-main" role="main">
406
407
408 <div class="bd-content">
409 <div class="bd-article-container">
410
411 <div class="bd-header-article d-print-none">
412 <div class="header-article-items header-article__inner">
413
414 <div class="header-article-items__start">
415
416 <div class="header-article-item">
417
418 <nav aria-label="Breadcrumb" class="d-print-none">
419 <ul class="bd-breadcrumbs">
420
421 <li class="breadcrumb-item breadcrumb-home">
422 <a href="../../index.html" class="nav-link" aria-label="Home">
423 <i class="fa-solid fa-home"></i>
424 </a>
425 </li>
426
427 <li class="breadcrumb-item"><a href="../../server.html" class="nav-link"><span class="section-number">5. </span>Server</a></li>
428
429
430 <li class="breadcrumb-item"><a href="../http.html" class="nav-link"><span class="section-number">5.2. </span>HTTP</a></li>
431
432 <li class="breadcrumb-item active" aria-current="page"><span class="ellipsis"><span class="section-number">5.2.1. </span>Comparison</span></li>
433 </ul>
434 </nav>
435 </div>
436
437 </div>
438
439
440 </div>
441 </div>
442
443
444
445
446 <div id="searchbox"></div>
447 <article class="bd-article">
448
449 <section id="comparison">
450 <h1><span class="section-number">5.2.1. </span>Comparison<a class="headerlink" href="#comparison" title="Link to this heading">#</a></h1>
451 <p>There are many differences between <a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> and
452 <a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a>. Here is a comparison table.</p>
453 <div class="pst-scrollable-table-container"><table class="table">
454 <thead>
455 <tr class="row-odd"><th class="head"></th>
456 <th class="head"><p>groonga</p></th>
457 <th class="head"><p>groonga-httpd</p></th>
458 </tr>
459 </thead>
460 <tbody>
461 <tr class="row-even"><td><p>Performance</p></td>
462 <td><p>o</p></td>
463 <td><p>o</p></td>
464 </tr>
465 <tr class="row-odd"><td><p>Using multi CPU cores</p></td>
466 <td><p>o (by multi threading)</p></td>
467 <td><p>o (by multi process)</p></td>
468 </tr>
469 <tr class="row-even"><td><p>Configuration file</p></td>
470 <td><p>optional</p></td>
471 <td><p>required</p></td>
472 </tr>
473 <tr class="row-odd"><td><p>Custom prefix path</p></td>
474 <td><p>x</p></td>
475 <td><p>o</p></td>
476 </tr>
477 <tr class="row-even"><td><p>Custom command version</p></td>
478 <td><p>o</p></td>
479 <td><p>o</p></td>
480 </tr>
481 <tr class="row-odd"><td><p>Multi databases</p></td>
482 <td><p>x</p></td>
483 <td><p>o</p></td>
484 </tr>
485 <tr class="row-even"><td><p>Authentication</p></td>
486 <td><p>x</p></td>
487 <td><p>o</p></td>
488 </tr>
489 <tr class="row-odd"><td><p>Gzip compression</p></td>
490 <td><p>x</p></td>
491 <td><p>o</p></td>
492 </tr>
493 <tr class="row-even"><td><p>POST</p></td>
494 <td><p>o</p></td>
495 <td><p>o</p></td>
496 </tr>
497 <tr class="row-odd"><td><p>HTTPS</p></td>
498 <td><p>x</p></td>
499 <td><p>o</p></td>
500 </tr>
501 <tr class="row-even"><td><p>Access log</p></td>
502 <td><p>x</p></td>
503 <td><p>o</p></td>
504 </tr>
505 <tr class="row-odd"><td><p>Upgrading without downtime</p></td>
506 <td><p>x</p></td>
507 <td><p>o</p></td>
508 </tr>
509 </tbody>
510 </table>
511 </div>
512 <section id="performance">
513 <h2><span class="section-number">5.2.1.1. </span>Performance<a class="headerlink" href="#performance" title="Link to this heading">#</a></h2>
514 <p>Both <a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> and <a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> are very fast. They can
515 work with the same throughput.</p>
516 </section>
517 <section id="using-multi-cpu-cores">
518 <h2><span class="section-number">5.2.1.2. </span>Using multi CPU cores<a class="headerlink" href="#using-multi-cpu-cores" title="Link to this heading">#</a></h2>
519 <p>Groonga scales on multi CPU cores. <a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> scales by multi
520 threading. <a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> scales by multi processes.</p>
521 <p><a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> uses the same number of threads as CPU cores by
522 default. If you have 8 CPU cores, 8 threads are used by default.</p>
523 <p><a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> uses 1 process by default. You need to set
524 <a class="reference external" href="http://nginx.org/en/docs/ngx_core_module.html#worker_processes">worker_processes</a>
525 directive to use CPU cores. If you have 8 CPU cores, specify
526 <code class="docutils literal notranslate"><span class="pre">worker_processes</span> <span class="pre">8</span></code> in configuration file like the following:</p>
527 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">worker_processes</span> <span class="mi">8</span><span class="p">;</span>
528
529 <span class="n">http</span> <span class="p">{</span>
530 <span class="c1"># ...</span>
531 <span class="p">}</span>
532 </pre></div>
533 </div>
534 </section>
535 <section id="configuration-file">
536 <h2><span class="section-number">5.2.1.3. </span>Configuration file<a class="headerlink" href="#configuration-file" title="Link to this heading">#</a></h2>
537 <p><a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> can work without configuration file. All configuration
538 items such as port number and the max number of threads can be
539 specified by command line. Configuration file is also used to specify
540 configuration items.</p>
541 <p>It’s very easy to run groonga HTTP server because <a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a>
542 requires just a few options to run. Here is the most simple command
543 line to start HTTP server by <a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a>:</p>
544 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">groonga</span> <span class="o">--</span><span class="n">protocol</span> <span class="n">http</span> <span class="o">-</span><span class="n">d</span> <span class="o">/</span><span class="n">PATH</span><span class="o">/</span><span class="n">TO</span><span class="o">/</span><span class="n">DATABASE</span>
545 </pre></div>
546 </div>
547 <p><a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> requires configuration file to run. Here is the
548 most simple configuration file to start HTTP server by
549 <a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a>:</p>
550 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">events</span> <span class="p">{</span>
551 <span class="p">}</span>
552
553 <span class="n">http</span> <span class="p">{</span>
554 <span class="n">server</span> <span class="p">{</span>
555 <span class="n">listen</span> <span class="mi">10041</span><span class="p">;</span>
556
557 <span class="n">location</span> <span class="o">/</span><span class="n">d</span><span class="o">/</span> <span class="p">{</span>
558 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
559 <span class="n">groonga_database</span> <span class="o">/</span><span class="n">PATH</span><span class="o">/</span><span class="n">TO</span><span class="o">/</span><span class="n">DATABASE</span><span class="p">;</span>
560 <span class="p">}</span>
561 <span class="p">}</span>
562 <span class="p">}</span>
563 </pre></div>
564 </div>
565 </section>
566 <section id="custom-prefix-path">
567 <h2><span class="section-number">5.2.1.4. </span>Custom prefix path<a class="headerlink" href="#custom-prefix-path" title="Link to this heading">#</a></h2>
568 <p><a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> accepts a path that starts with <code class="docutils literal notranslate"><span class="pre">/d/</span></code> as command URL
569 such as <code class="docutils literal notranslate"><span class="pre">http://localhost:10041/d/status</span></code>. You cannot change the
570 prefix path <code class="docutils literal notranslate"><span class="pre">/d/</span></code>.</p>
571 <p><a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> can custom prefix path. For example, you can use
572 <code class="docutils literal notranslate"><span class="pre">http://localhost:10041/api/status</span></code> as command URL. Here is a sample
573 configuration to use <code class="docutils literal notranslate"><span class="pre">/api/</span></code> as prefix path:</p>
574 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">events</span> <span class="p">{</span>
575 <span class="p">}</span>
576
577 <span class="n">http</span> <span class="p">{</span>
578 <span class="n">server</span> <span class="p">{</span>
579 <span class="n">listen</span> <span class="mi">10041</span><span class="p">;</span>
580
581 <span class="n">location</span> <span class="o">/</span><span class="n">api</span><span class="o">/</span> <span class="p">{</span> <span class="c1"># &lt;- change this</span>
582 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
583 <span class="n">groonga_database</span> <span class="o">/</span><span class="n">PATH</span><span class="o">/</span><span class="n">TO</span><span class="o">/</span><span class="n">DATABASE</span><span class="p">;</span>
584 <span class="p">}</span>
585 <span class="p">}</span>
586 <span class="p">}</span>
587 </pre></div>
588 </div>
589 </section>
590 <section id="custom-command-version">
591 <h2><span class="section-number">5.2.1.5. </span>Custom command version<a class="headerlink" href="#custom-command-version" title="Link to this heading">#</a></h2>
592 <p>Groonga has <a class="reference internal" href="../../reference/command/command_version.html"><span class="doc">Command version</span></a> mechanism. It is for
593 upgrading groonga commands with backward compatibility.</p>
594 <p><a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> can change the default command version by
595 <code class="docutils literal notranslate"><span class="pre">--default-command-version</span></code> option. Here is a sample command line to
596 use command version 2 as the default command version:</p>
597 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">groonga</span> <span class="o">--</span><span class="n">protocol</span> <span class="n">http</span> <span class="o">--</span><span class="n">default</span><span class="o">-</span><span class="n">command</span><span class="o">-</span><span class="n">version</span> <span class="mi">2</span> <span class="o">-</span><span class="n">d</span> <span class="o">/</span><span class="n">PATH</span><span class="o">/</span><span class="n">TO</span><span class="o">/</span><span class="n">DATABASE</span>
598 </pre></div>
599 </div>
600 <p><a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> cannot custom the default command version
601 yet. But it will be supported soon. If it is supported, you can
602 provides different command version groonga commands in the same
603 <a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> process. Here is a sample configuration to
604 provide command version 1 commands under <code class="docutils literal notranslate"><span class="pre">/api/1/</span></code> and command
605 version 2 commands under <code class="docutils literal notranslate"><span class="pre">/api/2/</span></code>:</p>
606 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">events</span> <span class="p">{</span>
607 <span class="p">}</span>
608
609 <span class="n">http</span> <span class="p">{</span>
610 <span class="n">server</span> <span class="p">{</span>
611 <span class="n">listen</span> <span class="mi">10041</span><span class="p">;</span>
612
613 <span class="n">groonga_database</span> <span class="o">/</span><span class="n">PATH</span><span class="o">/</span><span class="n">TO</span><span class="o">/</span><span class="n">DATABASE</span><span class="p">;</span>
614
615 <span class="n">location</span> <span class="o">/</span><span class="n">api</span><span class="o">/</span><span class="mi">1</span><span class="o">/</span> <span class="p">{</span>
616 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
617 <span class="n">groonga_default_command_version</span> <span class="mi">1</span><span class="p">;</span>
618 <span class="p">}</span>
619
620 <span class="n">location</span> <span class="o">/</span><span class="n">api</span><span class="o">/</span><span class="mi">2</span><span class="o">/</span> <span class="p">{</span>
621 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
622 <span class="n">groonga_default_command_version</span> <span class="mi">2</span><span class="p">;</span>
623 <span class="p">}</span>
624 <span class="p">}</span>
625 <span class="p">}</span>
626 </pre></div>
627 </div>
628 </section>
629 <section id="multi-databases">
630 <h2><span class="section-number">5.2.1.6. </span>Multi databases<a class="headerlink" href="#multi-databases" title="Link to this heading">#</a></h2>
631 <p><a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> can use only one database in a process.</p>
632 <p><a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> can use one or more databases in a process. Here
633 is a sample configuration to provide <code class="docutils literal notranslate"><span class="pre">/tmp/db1</span></code> database under
634 <code class="docutils literal notranslate"><span class="pre">/db1/</span></code> path and <code class="docutils literal notranslate"><span class="pre">/tmp/db2</span></code> database under <code class="docutils literal notranslate"><span class="pre">/db2/</span></code> path:</p>
635 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">events</span> <span class="p">{</span>
636 <span class="p">}</span>
637
638 <span class="n">http</span> <span class="p">{</span>
639 <span class="n">server</span> <span class="p">{</span>
640 <span class="n">listen</span> <span class="mi">10041</span><span class="p">;</span>
641
642 <span class="n">location</span> <span class="o">/</span><span class="n">db1</span><span class="o">/</span> <span class="p">{</span>
643 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
644 <span class="n">groonga_database</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">db1</span><span class="p">;</span>
645 <span class="p">}</span>
646
647 <span class="n">location</span> <span class="o">/</span><span class="n">db2</span><span class="o">/</span> <span class="p">{</span>
648 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
649 <span class="n">groonga_database</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">db2</span><span class="p">;</span>
650 <span class="p">}</span>
651 <span class="p">}</span>
652 <span class="p">}</span>
653 </pre></div>
654 </div>
655 </section>
656 <section id="authentication">
657 <h2><span class="section-number">5.2.1.7. </span>Authentication<a class="headerlink" href="#authentication" title="Link to this heading">#</a></h2>
658 <p>HTTP supports authentications such as basic authentication and digest
659 authentication. It can be used for restricting use of danger command such
660 as <a class="reference internal" href="../../reference/commands/shutdown.html"><span class="doc">shutdown</span></a>.</p>
661 <p><a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> doesn’t support any authentications. To restrict use of
662 danger command, other tools such as iptables and reverse proxy are
663 needed.</p>
664 <p><a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> supports basic authentication. Here is a sample
665 configuration to restrict use of <a class="reference internal" href="../../reference/commands/shutdown.html"><span class="doc">shutdown</span></a>
666 command:</p>
667 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">events</span> <span class="p">{</span>
668 <span class="p">}</span>
669
670 <span class="n">http</span> <span class="p">{</span>
671 <span class="n">server</span> <span class="p">{</span>
672 <span class="n">listen</span> <span class="mi">10041</span><span class="p">;</span>
673
674 <span class="n">groonga_database</span> <span class="o">/</span><span class="n">PATH</span><span class="o">/</span><span class="n">TO</span><span class="o">/</span><span class="n">DATABASE</span><span class="p">;</span>
675
676 <span class="n">location</span> <span class="o">/</span><span class="n">d</span><span class="o">/</span><span class="n">shutdown</span> <span class="p">{</span>
677 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
678 <span class="n">auth_basic</span> <span class="s2">&quot;manager is required!&quot;</span><span class="p">;</span>
679 <span class="n">auth_basic_user_file</span> <span class="s2">&quot;/etc/managers.htpasswd&quot;</span><span class="p">;</span>
680 <span class="p">}</span>
681
682 <span class="n">location</span> <span class="o">/</span><span class="n">d</span><span class="o">/</span> <span class="p">{</span>
683 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
684 <span class="p">}</span>
685 <span class="p">}</span>
686 <span class="p">}</span>
687 </pre></div>
688 </div>
689 </section>
690 <section id="gzip-compression">
691 <h2><span class="section-number">5.2.1.8. </span>Gzip compression<a class="headerlink" href="#gzip-compression" title="Link to this heading">#</a></h2>
692 <p>HTTP supports response compression by gzip with <code class="docutils literal notranslate"><span class="pre">Content-Encoding:</span>
693 <span class="pre">gzip</span></code> response header. It can reduce network flow. It is useful
694 for large search response.</p>
695 <p><a class="reference internal" href="groonga.html"><span class="doc">groonga</span></a> doesn’t support compression. To support compression,
696 reverse proxy is needed.</p>
697 <p><a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> supports gzip compression. Here is a sample
698 configuration to compress response by gzip:</p>
699 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">events</span> <span class="p">{</span>
700 <span class="p">}</span>
701
702 <span class="n">http</span> <span class="p">{</span>
703 <span class="n">server</span> <span class="p">{</span>
704 <span class="n">listen</span> <span class="mi">10041</span><span class="p">;</span>
705
706 <span class="n">groonga_database</span> <span class="o">/</span><span class="n">PATH</span><span class="o">/</span><span class="n">TO</span><span class="o">/</span><span class="n">DATABASE</span><span class="p">;</span>
707
708 <span class="n">location</span> <span class="o">/</span><span class="n">d</span><span class="o">/</span> <span class="p">{</span>
709 <span class="n">groonga</span> <span class="n">on</span><span class="p">;</span>
710 <span class="n">gzip</span> <span class="n">on</span><span class="p">;</span>
711 <span class="n">gzip_types</span> <span class="o">*</span><span class="p">;</span>
712 <span class="p">}</span>
713 <span class="p">}</span>
714 <span class="p">}</span>
715 </pre></div>
716 </div>
717 <p>Note that <cite>gzip_types *</cite> is specified. It’s one of the important
718 configuration. <cite>gzip_types</cite> specifies gzip target data formats by MIME
719 types. <a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> returns one of JSON, XML or MessagePack
720 format data. But those formats aren’t included in the default value of
721 <cite>gzip_types</cite>. The default value of <cite>gzip_types</cite> is <cite>text/html</cite>.</p>
722 <p>To compress response data from <a class="reference internal" href="groonga-httpd.html"><span class="doc">groonga-httpd</span></a> by gzip, you need
723 to specify <cite>gzip_types *</cite> or <cite>gzip_types application/json text/xml
724 application/x-msgpack</cite> explicitly. <cite>gzip_types *</cite> is recommended.
725 There are two reasons for it. The first, groonga may support more
726 formats in the future. The second, all requests for the <cite>location</cite> are
727 processed by groonga. You don’t need to consider about other modules.</p>
728 </section>
729 <section id="post">
730 <h2><span class="section-number">5.2.1.9. </span>POST<a class="headerlink" href="#post" title="Link to this heading">#</a></h2>
731 <p>You can load your data by POST JSON data. You need follow the
732 following rules to use loading by POST.</p>
733 <ul class="simple">
734 <li><p><cite>Content-Type</cite> header value must be <cite>application/json</cite>.</p></li>
735 <li><p>JSON data is sent as body.</p></li>
736 <li><p>Table name is specified by query parameter such as <code class="docutils literal notranslate"><span class="pre">table=NAME</span></code>.</p></li>
737 </ul>
738 <p>Here is an example curl command line that loads two users <cite>alice</cite> and
739 <cite>bob</cite> to <cite>Users</cite> table:</p>
740 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">curl</span> <span class="o">--</span><span class="n">data</span><span class="o">-</span><span class="n">binary</span> <span class="s1">&#39;[{&quot;_key&quot;: &quot;alice&quot;}, {&quot;_key&quot;: &quot;bob&quot;}]&#39;</span> <span class="o">-</span><span class="n">H</span> <span class="s2">&quot;Content-Type: application/json&quot;</span> <span class="s2">&quot;http://localhost:10041/d/load?table=Users&quot;</span>
741 </pre></div>
742 </div>
743 </section>
744 <section id="https">
745 <h2><span class="section-number">5.2.1.10. </span>HTTPS<a class="headerlink" href="#https" title="Link to this heading">#</a></h2>
746 <p>TODO</p>
747 </section>
748 <section id="access-log">
749 <h2><span class="section-number">5.2.1.11. </span>Access log<a class="headerlink" href="#access-log" title="Link to this heading">#</a></h2>
750 <p>TODO</p>
751 </section>
752 <section id="upgrading-without-downtime">
753 <h2><span class="section-number">5.2.1.12. </span>Upgrading without downtime<a class="headerlink" href="#upgrading-without-downtime" title="Link to this heading">#</a></h2>
754 <p>TODO</p>
755 </section>
756 </section>
757
758
759 </article>
760
761
762
763
764
765 <footer class="prev-next-footer d-print-none">
766
767 <div class="prev-next-area">
768 <a class="left-prev"
769 href="../http.html"
770 title="previous page">
771 <i class="fa-solid fa-angle-left"></i>
772 <div class="prev-next-info">
773 <p class="prev-next-subtitle">previous</p>
774 <p class="prev-next-title"><span class="section-number">5.2. </span>HTTP</p>
775 </div>
776 </a>
777 <a class="right-next"
778 href="groonga.html"
779 title="next page">
780 <div class="prev-next-info">
781 <p class="prev-next-subtitle">next</p>
782 <p class="prev-next-title"><span class="section-number">5.2.2. </span>groonga</p>
783 </div>
784 <i class="fa-solid fa-angle-right"></i>
785 </a>
786 </div>
787 </footer>
788
789 </div>
790
791
792
793 <dialog id="pst-secondary-sidebar-modal"></dialog>
794 <div id="pst-secondary-sidebar" class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">
795
796
797 <div class="sidebar-secondary-item">
798 <div
799 id="pst-page-navigation-heading-2"
800 class="page-toc tocsection onthispage">
801 <i class="fa-solid fa-list"></i> On this page
802 </div>
803 <nav id="pst-page-toc-nav" class="page-toc" aria-labelledby="pst-page-navigation-heading-2">
804 <ul class="pst-show_toc_level nav section-nav flex-column">
805 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#performance">5.2.1.1. Performance</a></li>
806 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#using-multi-cpu-cores">5.2.1.2. Using multi CPU cores</a></li>
807 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#configuration-file">5.2.1.3. Configuration file</a></li>
808 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#custom-prefix-path">5.2.1.4. Custom prefix path</a></li>
809 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#custom-command-version">5.2.1.5. Custom command version</a></li>
810 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#multi-databases">5.2.1.6. Multi databases</a></li>
811 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#authentication">5.2.1.7. Authentication</a></li>
812 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#gzip-compression">5.2.1.8. Gzip compression</a></li>
813 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#post">5.2.1.9. POST</a></li>
814 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#https">5.2.1.10. HTTPS</a></li>
815 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#access-log">5.2.1.11. Access log</a></li>
816 <li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#upgrading-without-downtime">5.2.1.12. Upgrading without downtime</a></li>
817 </ul>
818 </nav></div>
819
820 <div class="sidebar-secondary-item">
821
822
823 <div class="tocsection editthispage">
824 <a href="https://github.com/groonga/groonga/edit/main/doc/source/server/http/comparison.rst">
825 <i class="fa-solid fa-pencil"></i>
826
827
828
829 Edit on GitHub
830
831
832 </a>
833 </div>
834 </div>
835
836 </div></div>
837
838
839 </div>
840 <footer class="bd-footer-content">
841
842 </footer>
843
844 </main>
845 </div>
846 </div>
847
848 <!-- Scripts loaded after <body> so the DOM is not blocked -->
849 <script defer src="../../_static/scripts/bootstrap.js?digest=90905a2f556bf617f1a9"></script>
850 <script defer src="../../_static/scripts/pydata-sphinx-theme.js?digest=90905a2f556bf617f1a9"></script>
851
852 <footer class="bd-footer">
853 <div class="bd-footer__inner bd-page-width">
854
855 <div class="footer-items__start">
856
857 <div class="footer-item">
858
859 <p class="copyright">
860
861 © Copyright 2009-2026 Groonga Project.
862 <br/>
863
864 </p>
865 </div>
866
867 </div>
868
869
870
871 <div class="footer-items__end">
872
873 <div class="footer-item">
874 <p class="theme-version">
875 <!-- # L10n: Setting the PST URL as an argument as this does not need to be localized -->
876 Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.20.0.
877 </p></div>
878
879 </div>
880
881 </div>
882
883 </footer>
884 </body>
885 </html>