Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pravega and BookKeeper Java options #145

Merged
merged 4 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- stage: e2e
name: End-to-end tests
if: type = pull_request OR branch = master
if: type = pull_request OR branch = master OR tag IS present
services:
- docker
env:
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:

- stage: deploy
name: Push Docker image
if: branch = master AND tag IS present
if: type != pull_request AND tag IS present
Tristan1900 marked this conversation as resolved.
Show resolved Hide resolved
services:
- docker
script:
Expand Down
25 changes: 21 additions & 4 deletions pkg/controller/pravega/bookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,18 @@ func makeBookieVolumeClaimTemplates(spec *v1alpha1.BookkeeperSpec) []corev1.Pers
}

func MakeBookieConfigMap(pravegaCluster *v1alpha1.PravegaCluster) *corev1.ConfigMap {
javaOpts := []string{
memoryOpts := []string{
"-Xms1g",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseCGroupMemoryLimitForHeap",
"-XX:MaxRAMFraction=1",
"-XX:MaxRAMFraction=2",
"-XX:MaxDirectMemorySize=1g",
"-XX:+ExitOnOutOfMemoryError",
"-XX:+CrashOnOutOfMemoryError",
"-XX:+HeapDumpOnOutOfMemoryError",
}

gcOpts := []string{
"-XX:+UseG1GC",
"-XX:MaxGCPauseMillis=10",
"-XX:+ParallelRefProcEnabled",
Expand All @@ -202,9 +208,20 @@ func MakeBookieConfigMap(pravegaCluster *v1alpha1.PravegaCluster) *corev1.Config
"-XX:-ResizePLAB",
}

gcLoggingOpts := []string{
"-XX:+PrintGCDetails",
Tristan1900 marked this conversation as resolved.
Show resolved Hide resolved
"-XX:+PrintGCDateStamps",
"-XX:+PrintGCApplicationStoppedTime",
"-XX:+UseGCLogFileRotation",
"-XX:NumberOfGCLogFiles=5",
"-XX:GCLogFileSize=64m",
}

configData := map[string]string{
"BK_BOOKIE_EXTRA_OPTS": strings.Join(javaOpts, " "),
"ZK_URL": pravegaCluster.Spec.ZookeeperUri,
"BOOKIE_MEM_OPTS": strings.Join(memoryOpts, " "),
"BOOKIE_GC_OPTS": strings.Join(gcOpts, " "),
"BOOKIE_GC_LOGGING_OPTS": strings.Join(gcLoggingOpts, " "),
"ZK_URL": pravegaCluster.Spec.ZookeeperUri,
// Set useHostNameAsBookieID to false until BookKeeper Docker
// image is updated to 4.7
// This value can be explicitly overridden when using the operator
Expand Down
6 changes: 5 additions & 1 deletion pkg/controller/pravega/pravega_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ func makeControllerPodSpec(name string, pravegaSpec *api.PravegaSpec) *corev1.Po

func MakeControllerConfigMap(p *api.PravegaCluster) *corev1.ConfigMap {
var javaOpts = []string{
"-Xms1g",
"-Xms512m",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseCGroupMemoryLimitForHeap",
"-XX:MaxRAMFraction=2",
"-XX:+ExitOnOutOfMemoryError",
"-XX:+CrashOnOutOfMemoryError",
"-XX:+HeapDumpOnOutOfMemoryError",
"-Dpravegaservice.clusterName=" + p.Name,
}

Expand Down
5 changes: 4 additions & 1 deletion pkg/controller/pravega/pravega_segmentstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ func MakeSegmentstoreConfigMap(p *api.PravegaCluster) *corev1.ConfigMap {
"-Xms1g",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseCGroupMemoryLimitForHeap",
"-XX:MaxRAMFraction=1",
"-XX:MaxRAMFraction=2",
"-XX:+ExitOnOutOfMemoryError",
"-XX:+CrashOnOutOfMemoryError",
"-XX:+HeapDumpOnOutOfMemoryError",
"-Dpravegaservice.clusterName=" + p.Name,
}

Expand Down