{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/comments/76328561","id":76328561,"diff_hunk":"@@ -9,20 +9,52 @@ secret_dir=/etc/elasticsearch/secret/\n [ -f $secret_dir/keystore.password ] && export KEYSTORE_PASSWORD=$(cat $secret_dir/keystore.password)\n [ -f $secret_dir/truststore.password ] && export TRUSTSTORE_PASSWORD=$(cat $secret_dir/truststore.password)\n \n+BYTES_PER_MEG=$((1024*1024))\n+BYTES_PER_GIG=$((1024*${BYTES_PER_MEG}))\n+\n+MAX_ES_MEMORY_BYTES=$((64*${BYTES_PER_GIG}))\n+MIN_ES_MEMORY_BYTES=$((256*${BYTES_PER_MEG}))\n+\n # the amount of RAM allocated should be half of available instance RAM.\n # ref. https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html#_give_half_your_memory_to_lucene\n+# parts inspired by https://github.com/fabric8io-images/run-java-sh/blob/master/fish-pepper/run-java-sh/fp-files/java-container-options\n regex='^([[:digit:]]+)([GgMm])$'\n if [[ \"${INSTANCE_RAM:-}\" =~ $regex ]]; then\n \tnum=${BASH_REMATCH[1]}\n \tunit=${BASH_REMATCH[2]}\n \tif [[ $unit =~ [Gg] ]]; then\n-\t\t((num = num * 1024)) # enables math to work out for odd Gi\n+\t\t((num = num * ${BYTES_PER_GIG})) # enables math to work out for odd Gi\n+\telif [[ $unit =~ [Mm] ]]; then","path":"elasticsearch/run.sh","position":20,"original_position":20,"commit_id":"fd35adcb6bc578d466c1a9018e1e63b7ff3e3e64","original_commit_id":"fd35adcb6bc578d466c1a9018e1e63b7ff3e3e64","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"body":"I don't really follow since this is still required to properly convert to the base unit of bytes.","created_at":"2016-08-25T21:30:28Z","updated_at":"2016-08-25T21:30:28Z","html_url":"https://github.com/openshift/origin-aggregated-logging/pull/212#discussion_r76328561","pull_request_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/comments/76328561"},"html":{"href":"https://github.com/openshift/origin-aggregated-logging/pull/212#discussion_r76328561"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212","id":82773655,"html_url":"https://github.com/openshift/origin-aggregated-logging/pull/212","diff_url":"https://github.com/openshift/origin-aggregated-logging/pull/212.diff","patch_url":"https://github.com/openshift/origin-aggregated-logging/pull/212.patch","issue_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/issues/212","number":212,"state":"open","locked":false,"title":"adjust heap memory based on that allowed by container or recommended max","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"body":"fixes bug 1370115 https://bugzilla.redhat.com/show_bug.cgi?id=1370115 by:\r\n* comparing the requested memory to the max recommended by Elastic and\r\n  that which is available to the container","created_at":"2016-08-25T18:56:23Z","updated_at":"2016-08-25T21:30:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f08530e2219ef0e91fdc2e6a2b3fdab87efbdd3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212/commits","review_comments_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212/comments","review_comment_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/issues/212/comments","statuses_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/statuses/fd35adcb6bc578d466c1a9018e1e63b7ff3e3e64","head":{"label":"jcantrill:bz1370115_autotune_memory","ref":"bz1370115_autotune_memory","sha":"fd35adcb6bc578d466c1a9018e1e63b7ff3e3e64","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"repo":{"id":42534471,"name":"origin-aggregated-logging","full_name":"jcantrill/origin-aggregated-logging","owner":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcantrill/origin-aggregated-logging","description":"","fork":true,"url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging","forks_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/forks","keys_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/teams","hooks_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/hooks","issue_events_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/issues/events{/number}","events_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/events","assignees_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/assignees{/user}","branches_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/branches{/branch}","tags_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/tags","blobs_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/statuses/{sha}","languages_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/languages","stargazers_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/stargazers","contributors_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/contributors","subscribers_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/subscribers","subscription_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/subscription","commits_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/contents/{+path}","compare_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/merges","archive_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/downloads","issues_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/issues{/number}","pulls_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/pulls{/number}","milestones_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/milestones{/number}","notifications_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/labels{/name}","releases_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/releases{/id}","deployments_url":"https://api.github.com/repos/jcantrill/origin-aggregated-logging/deployments","created_at":"2015-09-15T17:17:48Z","updated_at":"2016-04-05T19:26:33Z","pushed_at":"2016-08-25T18:55:41Z","git_url":"git://github.com/jcantrill/origin-aggregated-logging.git","ssh_url":"git@github.com:jcantrill/origin-aggregated-logging.git","clone_url":"https://github.com/jcantrill/origin-aggregated-logging.git","svn_url":"https://github.com/jcantrill/origin-aggregated-logging","homepage":null,"size":537,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"8b24b3b8570e092aa664aba396efbc6a451117e2","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":42467822,"name":"origin-aggregated-logging","full_name":"openshift/origin-aggregated-logging","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin-aggregated-logging","description":"","fork":false,"url":"https://api.github.com/repos/openshift/origin-aggregated-logging","forks_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/forks","keys_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/teams","hooks_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/events","assignees_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/tags","blobs_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/languages","stargazers_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/subscription","commits_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/merges","archive_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/downloads","issues_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin-aggregated-logging/deployments","created_at":"2015-09-14T18:14:19Z","updated_at":"2016-07-08T19:02:43Z","pushed_at":"2016-08-25T18:56:23Z","git_url":"git://github.com/openshift/origin-aggregated-logging.git","ssh_url":"git@github.com:openshift/origin-aggregated-logging.git","clone_url":"https://github.com/openshift/origin-aggregated-logging.git","svn_url":"https://github.com/openshift/origin-aggregated-logging","homepage":null,"size":727,"stargazers_count":9,"watchers_count":9,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":28,"forks":34,"open_issues":28,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212"},"html":{"href":"https://github.com/openshift/origin-aggregated-logging/pull/212"},"issue":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/issues/212"},"comments":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/issues/212/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/pulls/212/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin-aggregated-logging/statuses/fd35adcb6bc578d466c1a9018e1e63b7ff3e3e64"}}}}
{"actor":{"display_login":"jcantrill"}}