Skip to content

Commit 855faff

Browse files
committed
Merge pull request #6822 from tylersmalley/default-node-arguments
Limit memory overhead
2 parents 322fa9b + e8e9f58 commit 855faff

6 files changed

Lines changed: 32 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Kibana is an open source ([Apache Licensed](https://github.com/elastic/kibana/bl
66

77
- Elasticsearch master
88
- Kibana binary package
9+
- 512 MB of available RAM
910

1011
## Installation
1112

@@ -14,7 +15,6 @@ Kibana is an open source ([Apache Licensed](https://github.com/elastic/kibana/bl
1415
* Run `bin/kibana` on unix, or `bin\kibana.bat` on Windows.
1516
* Visit [http://localhost:5601](http://localhost:5601)
1617

17-
1818
## Upgrade from previous version
1919

2020
* Move any custom configurations in your old kibana.yml to your new one

bin/kibana

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ if [ ! -x "$NODE" ]; then
2121
exit 1
2222
fi
2323

24+
# sets V8 defaults while still allowing them to be overridden
25+
if echo "${@}" | grep -qv "\-\-dev"; then
26+
NODE_OPTIONS="--max-old-space-size=256 $NODE_OPTIONS"
27+
fi
28+
2429
exec "${NODE}" $NODE_OPTIONS "${DIR}/src/cli" ${@}

bin/kibana.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ If Not Exist "%NODE%" (
2121
)
2222
)
2323

24+
echo.%* | findstr /V /C:"--dev" && set NODE_OPTIONS=--max-old-space-size=256 %NODE_OPTIONS%
25+
2426
TITLE Kibana Server
25-
"%NODE%" %NODE_OPTIONS% "%DIR%\src\cli" %*
27+
call "%NODE%" %NODE_OPTIONS% "%DIR%\src\cli" %*
2628

2729
:finally
2830

docs/production.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* <<enabling-ssl, Enabling SSL>>
55
* <<controlling-access, Controlling Access>>
66
* <<load-balancing, Load Balancing Across Multiple Elasticsearch Nodes>>
7+
* <<memory-management, Memory management>>
78

89
How you deploy Kibana largely depends on your use case. If you are the only user,
910
you can run Kibana on your local machine and configure it to point to whatever
@@ -132,3 +133,10 @@ cluster.name: "my_cluster"
132133
# The Elasticsearch instance to use for all your queries.
133134
elasticsearch_url: "http://localhost:9200"
134135
--------
136+
137+
[float]
138+
[[memory-management]]
139+
140+
=== Memory management
141+
142+
Kibana is built on Node.js which doesn't tune its heap size based on the amount of memory available. To combat this, we set defaults based on the requirements of Kibana needs, while allowing overhead for additional plugins. These defaults can be overridden at runtime, for example `NODE_OPTIONS="--max-old-space-size=512" bin/kibana`.

docs/setup.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All you need is:
55

66
* Elasticsearch {esversion}
77
* A modern web browser - http://www.elastic.co/subscriptions/matrix#matrix_browsers[Supported Browsers].
8+
* 512 MB of available RAM
89
* Information about your Elasticsearch installation:
910
** URL of the Elasticsearch instance you want to connect to.
1011
** Which Elasticsearch indices you want to search.

tasks/config/run.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ module.exports = function (grunt) {
2525
return flags;
2626
}, []);
2727

28+
const devEnv = Object.assign(process.env, {
29+
NODE_OPTIONS: '--max-old-space-size=1024'
30+
});
31+
2832
return {
2933
testServer: {
3034
options: {
3135
wait: false,
3236
ready: /Server running/,
3337
quiet: false,
34-
failOnError: false
38+
failOnError: false,
39+
env: devEnv
3540
},
3641
cmd: binScript,
3742
args: [
@@ -46,7 +51,8 @@ module.exports = function (grunt) {
4651
wait: false,
4752
ready: /Server running/,
4853
quiet: false,
49-
failOnError: false
54+
failOnError: false,
55+
env: devEnv
5056
},
5157
cmd: binScript,
5258
args: [
@@ -64,7 +70,8 @@ module.exports = function (grunt) {
6470
wait: false,
6571
ready: /Server running/,
6672
quiet: false,
67-
failOnError: false
73+
failOnError: false,
74+
env: devEnv
6875
},
6976
cmd: binScript,
7077
args: [
@@ -80,7 +87,8 @@ module.exports = function (grunt) {
8087
wait: false,
8188
ready: /Server running/,
8289
quiet: false,
83-
failOnError: false
90+
failOnError: false,
91+
env: devEnv
8492
},
8593
cmd: binScript,
8694
args: [
@@ -148,7 +156,8 @@ module.exports = function (grunt) {
148156
options: {
149157
wait: false,
150158
ready: /Optimization .+ complete/,
151-
quiet: true
159+
quiet: false,
160+
env: devEnv
152161
},
153162
cmd: './build/kibana/bin/kibana',
154163
args: [

0 commit comments

Comments
 (0)