Solved

Performance and setup of docker GoodData.CN container


  • Known Participant
  • 14 replies

Hi there!

Our team encountered very bad performance of GoodData.CN in docker container.

Here is our setup:

$ cat docker-compose.yml 
services:
gooddata:
image: gooddata/gooddata-cn-ce
container_name: gooddata-dev
restart: always
environment:
- LICENSE_AND_PRIVACY_POLICY_ACCEPTED=YES
ports:
- 3000:3000
- 5432:5432
volumes:
- ./data:/data

In htop output, I can see the following:

So the CPU is not overloaded and there is a lot of memory available. May be there is a way to fine-tune the software so that it could use more resources and run faster? For example, I can see that many java processes are limited to use 256m memory only.

Best regards, Nick.

icon

Best answer by Robert Moucha 12 May 2021, 12:46

Hello Nick,

it is possible to use the JAVA_OPTS environment variable to tune JVM settings, e.g. heap memory using -Xmx parameter.

The default value (256MiB) is set intentionally low to consume fewer resources on users’ laptops. 

Keep in mind that this variable is currently used for multiple components of GoodData CN CE so changing this setting will affect all Java applications running within the container. We plan to address this limitation in future versions of the image.

There are 6 services affected by JAVA_OPTS, so if you have 16GiB RAM in your server, you could safely allocate up to 2GiB JVM heap to every service (provided no other services are running aside from the GoodData CN container). Don’t forget to preserve the other JVM settings:

-e JAVA_OPTS=-Xmx1g -Xms128m -XX:+UseStringDeduplication -XX:+ExplicitGCInvokesConcurrent -XX:+ParallelRefProcEnabled

Performance tuning of any application is a complex task and there’s no “one size fits all” setting that could be recommended to all users. It highly depends on multiple factors, like data source DB size, logical model complexity, number of concurrent users, and so on.

However, we’d like to hear if you face a specific performance issue.

 

Kind regards,

Robert Moucha

View original

4 replies

Userlevel 1

Hi Nick, 

We appreciate your interest and comments on GoodData.CN! 

First off, may I know which version are you using? Some performance issues were fixed on version 1.0.1

Also, please make sure you are taking into consideration the basic requirements.

 

Best regards, 

 

-Moises

Hi Moises, thank you for quick reply!

I was using “gooddata/gooddata-cn-ce:latest” when I first installed, how can I check which version I am using now?

Here is the “docker image inspect” output:

$ docker image inspect ab80ada823da
[
{
"Id": "sha256:ab80ada823dac729495e00f7501e3cf35fc6d5999a7a2a3c1879f71862d3fcbe",
"RepoTags": [
"gooddata/gooddata-cn-ce:latest"
],
"RepoDigests": [
"gooddata/gooddata-cn-ce@sha256:9fa331ad26b6e29d1d058f94bacf4d00375b8ec502cdf901bdde79c7d17a7b13"
],
"Parent": "",
"Comment": "",
"Created": "2021-04-20T13:04:44.718975377Z",
"Container": "89cabef0b8ca632fee36e4501b261f2c3a2491d0767c93e53c2a756c922e6a7f",
"ContainerConfig": {
"Hostname": "89cabef0b8ca",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3000/tcp": {},
"5432/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=en_US.UTF-8",
"LANGUAGE=en_US:en",
"LC_ALL=en_US.UTF-8",
"JAVA_VERSION=jdk-11.0.10+9",
"JAVA_HOME=/opt/java/openjdk",
"DEMO=true",
"S6_BEHAVIOUR_IF_STAGE2_FAILS=2",
"EXTERNAL_PORT=3000",
"ALLOW_REDIRECT=https://localhost:8443",
"JAVA_OPTS=-Xmx256m -Xms128m -XX:+UseStringDeduplication -XX:+ExplicitGCInvokesConcurrent -XX:+ParallelRefProcEnabled",
"APP_LOGLEVEL=WARN",
"PULSAR_LOGLEVEL=WARN"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ",
"LABEL vcs-ref=0ca71295"
],
"Image": "sha256:3ddb9acdbcafc8e7362cbb115dbdf1b6e21f3f0b8d1b24350956697c4309daec",
"Volumes": {
"/data": {},
"/logs": {}
},
"WorkingDir": "/opt",
"Entrypoint": [
"/init"
],
"OnBuild": null,
"Labels": {
"vcs-ref": "0ca71295"
}
},
"DockerVersion": "19.03.13",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3000/tcp": {},
"5432/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=en_US.UTF-8",
"LANGUAGE=en_US:en",
"LC_ALL=en_US.UTF-8",
"JAVA_VERSION=jdk-11.0.10+9",
"JAVA_HOME=/opt/java/openjdk",
"DEMO=true",
"S6_BEHAVIOUR_IF_STAGE2_FAILS=2",
"EXTERNAL_PORT=3000",
"ALLOW_REDIRECT=https://localhost:8443",
"JAVA_OPTS=-Xmx256m -Xms128m -XX:+UseStringDeduplication -XX:+ExplicitGCInvokesConcurrent -XX:+ParallelRefProcEnabled",
"APP_LOGLEVEL=WARN",
"PULSAR_LOGLEVEL=WARN"
],
"Cmd": null,
"Image": "sha256:3ddb9acdbcafc8e7362cbb115dbdf1b6e21f3f0b8d1b24350956697c4309daec",
"Volumes": {
"/data": {},
"/logs": {}
},
"WorkingDir": "/opt",
"Entrypoint": [
"/init"
],
"OnBuild": null,
"Labels": {
"vcs-ref": "0ca71295"
}
},
"Architecture": "amd64",
"Os": "linux",
"Size": 1578470170,
"VirtualSize": 1578470170,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/573c8ba9ef4de0781d62d9263de87b72174de454b9cb3186cba94e55d078a607/diff:/var/lib/docker/overlay2/82ff16e4b6d322958a48154c5bd1f3c655e2436216ed4f06d128e3bef97bae51/diff:/var/lib/docker/overlay2/d6722f79804e51feace198f6fa3a35c7fb76e7dec32d556e7de540883b379d63/diff:/var/lib/docker/overlay2/b25a7bac4672b2a4a38d2e28920b58d4a84e68789ebda929e5397878457cf38f/diff:/var/lib/docker/overlay2/c1549ccd9cc1e618611d61f7971629a121f0453625d501e6e25f986d3e3280a5/diff:/var/lib/docker/overlay2/39d12055b293a2972d977ec88242eaa30a6ebaef0ecc83d73d8fe3b75f7116fd/diff:/var/lib/docker/overlay2/cd5c60cc46827902ac5ee4c4d1608961a07eb8112dca997fd9aebb521e075c5f/diff:/var/lib/docker/overlay2/09c2efb75147d664a24d81a81445bbcf5499a4f6ed2c45183f4204580e75eadb/diff:/var/lib/docker/overlay2/2f99b4d6e6210260733f5b7730d1aaf11def54ca6dfaf95ade21b9e63e853a1f/diff:/var/lib/docker/overlay2/25a1eb34593043200cea9209462afc7137f0be8cea921c38768024d0fb63aa3f/diff:/var/lib/docker/overlay2/6a662fa152b860ade1514d1f087f74de73601e190fe3cb6f021b116c56b7a085/diff:/var/lib/docker/overlay2/a123d2e1b7eb0c4bb856c851c88443469b4d97ebaea45b866a533ca46da04b20/diff:/var/lib/docker/overlay2/fd51563b26cdd0a3ed0e6f2259d9d0f24e46f09ee957d0e722040980d9ca98d5/diff:/var/lib/docker/overlay2/ce422531a09748d71c04621fe4c7395542c65820aac0eca062a32dd9592e4360/diff:/var/lib/docker/overlay2/e2c316db664a9e5644e84f547764014f034ff7be72dfdbf9a96d935fe74208de/diff:/var/lib/docker/overlay2/888d9d1d0451020283a38c52ab0d38e521858849739b6b6494f1f826620f79b6/diff:/var/lib/docker/overlay2/da2e739ae985f2687bf831d681e309267a4fc4743d92e2236a6eb9de7847669f/diff:/var/lib/docker/overlay2/1a87d8be39da229eb1653064ebbcc1da769c896766cc56bbe68655c90a24cd00/diff:/var/lib/docker/overlay2/cb2322ef3adb367a034ee2bcd918b5519fc785f092a8facb229853b63f7e84ba/diff:/var/lib/docker/overlay2/cad534efd372a0efec582c07f27c65ffdb30f1773c7ecfaf81fd8ad79767163b/diff:/var/lib/docker/overlay2/24b500b44e85ee446e1b78f2f10e193225ac92842a3b941cc222edd53967810a/diff:/var/lib/docker/overlay2/2a886b81fb44e2e6a649e0c2861a901e465ca52c1238e02faa7e16ee402ce2cd/diff:/var/lib/docker/overlay2/9addb2d457ee2a4d4fd3dc6043d82d4391b7fccb4dff9bc43694e8c456669f8b/diff:/var/lib/docker/overlay2/724ac1130c54de76cee8ede7ca9b15dab718a0a518d7fc899b00627878ec4f06/diff:/var/lib/docker/overlay2/53012b53ece98097c46cb42bcf8d89e4244d3e98bc41c4295ce49bd96d23314d/diff:/var/lib/docker/overlay2/ff65b7ca15b555b0841c4abb16934391aaee7c8157e7a8525df929463f98a36b/diff:/var/lib/docker/overlay2/bf51a83a24125bb8714720ba6324e337633aa97fcab727a7fed7f6dd19d05181/diff:/var/lib/docker/overlay2/7a2505881a2c0784492eb102271ebde466550ec68c31f5cf0874162d157aa71e/diff:/var/lib/docker/overlay2/ba256823c7a43f5e5d2ee19f55280d164f55c9600344a1957f301e9a0fbc6cef/diff:/var/lib/docker/overlay2/88e7ef46d7755b26be37906698c9346e27ca9be253a47a6796fd116b2af393d6/diff:/var/lib/docker/overlay2/92c3e38d9d187b4acb1c9cba0d658d051f06a234368b7b2c2bc6a2a27c2e4778/diff:/var/lib/docker/overlay2/e4f0ba48f075d23fe839f5e2a2b8b73a8350f56c170321927184daca495427a3/diff:/var/lib/docker/overlay2/020c9c6eea2d20c16ad00831c47d2705545b1f849639b96202711310864bf2c6/diff:/var/lib/docker/overlay2/46ca4d9886398d413e7e30dbcd3f6b6bea9f2cd01a64b667e58a7ebe3f7b8b90/diff:/var/lib/docker/overlay2/f47ef0e6624bdb9ef8d3cf592d97c33a9c2fc64bacc829a9f86ad280f82ccfb9/diff:/var/lib/docker/overlay2/591d4c5f00669e8512cade33d3904b128756162e3589081f3810cde8526c395d/diff",
"MergedDir": "/var/lib/docker/overlay2/5bb905c3db23049432b08afcc7b1c1c242d100b727f7e862177112b9c5c208f7/merged",
"UpperDir": "/var/lib/docker/overlay2/5bb905c3db23049432b08afcc7b1c1c242d100b727f7e862177112b9c5c208f7/diff",
"WorkDir": "/var/lib/docker/overlay2/5bb905c3db23049432b08afcc7b1c1c242d100b727f7e862177112b9c5c208f7/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:e2c6ff46235709f5178ab7c1939f4fba7237ffde84e13b1582fa5f0837c1d978",
"sha256:4f802b58b15c71655f73ad6f45c907d524a708c8e7103da14045439414dccc6d",
"sha256:33bf0c5eedfd2283cba76ab55259582eb46979dce1d7016298bb37e99e0f822d",
"sha256:e710e47582263b8043d4dfa695ee13d16615980cdb4b63d8ba36ce87a9382a71",
"sha256:ca006ab4dd10382873c80eb37b23793ff44cb4bdc4195169f655280a7000f42c",
"sha256:fae3be77e9e4bb14a4dcc9cc3af56c158721aa9f595c5469798cce6d6670dae4",
"sha256:ee86afd6724fba96551c534a17e89563bda61e49d4dad283c00d53b00f73645b",
"sha256:f475da364aa1383a2e7d56f3eb04820d3853cb506656aa627baf340715686d2b",
"sha256:ea5cf3bda998c0b55ac4833188ea5c4634a46ffffdb458761538506529313bb5",
"sha256:48ebd98cd5cc640ad49f7e8644adf93dc82c36c0f67389d16ee764fabf623d4c",
"sha256:ffa928c3ed1fccacc4c3ba1b6bf9647be51b1aa9100fb4ad6d22c07176655243",
"sha256:7a7779f511c4cee280f3c77a57126a3a6954f063dd173724d99ef04a406c9d8a",
"sha256:37677860341f66bd329ca9b149af0aa6956fd417fa7e23ab7746e89d1c4ef3e6",
"sha256:277dbcc0175e9c2813818a67cbb9ce19214510b940989909a3176c59caf0a327",
"sha256:92243e73f62ae03cd52248a71b72f0065dde9014ec7639c7c552ef528e9c1730",
"sha256:1efebf3ce6735c9ca8d1b6d55498a8bda5d89ae203b283aab0f815daf6a754ea",
"sha256:da284dd3675fc2ef237fc915d84f114600f96508d90b6ca4ff253b6230723063",
"sha256:73c0aa548bb57b4ffa0a267a571684801d4aa4ce342954e4f4dea92e2ab95ec4",
"sha256:92c75b5e52c1c87a11d7074587b366a4c99ac326e486e68fdee615aa59e03b0c",
"sha256:11c7f3fc32111928a7fedcc3b614a11ad86d15de8a6e75c82d66c427a8551a9d",
"sha256:959dccd868eadeb3f4524d797d4a97ef15a6fb73785df323808fb632b487e116",
"sha256:f46230e1875fe20ad87b45af15c326639e3bb0bd331bb0e46bc52bb3c049502b",
"sha256:e1585bee6ffbb5611cb2c7dfba725021ccb10e503620724bc68c576f427b9b12",
"sha256:a100b3edd8de0cb692eec70f88c4355a2e854578f10b340226a3c8c1706fc4cd",
"sha256:57b6c7d3a19ade12b742652b7c70d1ea9dbbad8355be0fc91f3dec1c62486805",
"sha256:82fc1fafb146ef7ef1262c6963bf76d52eee48fd16e1150d74405d29f9e610f0",
"sha256:7ed3ffee5008af128dfdc21a0c3d4a36b95bd71864d2e34273627b6a584f5c8f",
"sha256:0d9d37f9c75c1db72c83a5bc0a2e939bb7b094c29fd7a051907e7a504e47eb89",
"sha256:a9172ab7f8c8e9e6f7b918fbb4f847658e21a363401c2d9d38c055a094fd87a6",
"sha256:190d0adf552a64119b9971ac245663b90aa7ca71c9fbf5fe53a8178d828b0c7d",
"sha256:80bcc00c451dcb784accfb3e9fb75d4e78ea099bf3991f49efc977a2b0c70800",
"sha256:adb337db6f63019b388823be652da75fbf069c83e33e04e9e68ba1a467450b6f",
"sha256:ed7a2a369d8a531f6bdc8eed6d8dabbb3ac46c4599af6ddf20723e92f3ee1de4",
"sha256:5a030a988d09d8b05364266629d164ebf9551d7e31122c5ecd5c37aa2176482e",
"sha256:db75f17bb3ede797d53495ef3b52e19511718e4d1e93228e72b307ad8107b438",
"sha256:74c3c513bf8eb9eccd5dd125c1fa1fb65c12fcf24d21612445819e103a4a7648",
"sha256:17f81f245099f1e783f579c5713a2beadc09dbad3aa59c60a39b0745fac67d43"
]
},
"Metadata": {
"LastTagTime": "0001-01-01T00:00:00Z"
}
}
]

So I guess if I change JAVA_OPTS environment variable, I can change your default -Xmx setting? What is your recommended value?

Our test server has 16Gb RAM and 4 vCPUs.

 

Hello Nick,

it is possible to use the JAVA_OPTS environment variable to tune JVM settings, e.g. heap memory using -Xmx parameter.

The default value (256MiB) is set intentionally low to consume fewer resources on users’ laptops. 

Keep in mind that this variable is currently used for multiple components of GoodData CN CE so changing this setting will affect all Java applications running within the container. We plan to address this limitation in future versions of the image.

There are 6 services affected by JAVA_OPTS, so if you have 16GiB RAM in your server, you could safely allocate up to 2GiB JVM heap to every service (provided no other services are running aside from the GoodData CN container). Don’t forget to preserve the other JVM settings:

-e JAVA_OPTS=-Xmx1g -Xms128m -XX:+UseStringDeduplication -XX:+ExplicitGCInvokesConcurrent -XX:+ParallelRefProcEnabled

Performance tuning of any application is a complex task and there’s no “one size fits all” setting that could be recommended to all users. It highly depends on multiple factors, like data source DB size, logical model complexity, number of concurrent users, and so on.

However, we’d like to hear if you face a specific performance issue.

 

Kind regards,

Robert Moucha

Thank you, Robert! Will try tuning using JAVA_OPTS then!

Reply