{"action":"created","issue":{"url":"https://api.github.com/repos/autopilotpattern/mysql/issues/32","repository_url":"https://api.github.com/repos/autopilotpattern/mysql","labels_url":"https://api.github.com/repos/autopilotpattern/mysql/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/autopilotpattern/mysql/issues/32/comments","events_url":"https://api.github.com/repos/autopilotpattern/mysql/issues/32/events","html_url":"https://github.com/autopilotpattern/mysql/issues/32","id":156309929,"number":32,"title":"manage.py is writing invalid value for the innodb_buffer_pool_size","user":{"login":"headw01","id":5651137,"avatar_url":"https://avatars.githubusercontent.com/u/5651137?v=3","gravatar_id":"","url":"https://api.github.com/users/headw01","html_url":"https://github.com/headw01","followers_url":"https://api.github.com/users/headw01/followers","following_url":"https://api.github.com/users/headw01/following{/other_user}","gists_url":"https://api.github.com/users/headw01/gists{/gist_id}","starred_url":"https://api.github.com/users/headw01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headw01/subscriptions","organizations_url":"https://api.github.com/users/headw01/orgs","repos_url":"https://api.github.com/users/headw01/repos","events_url":"https://api.github.com/users/headw01/events{/privacy}","received_events_url":"https://api.github.com/users/headw01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-23T16:19:36Z","updated_at":"2016-05-23T16:35:35Z","closed_at":null,"body":"The manage.py script is writing an invalid value to the config file when it starts up.  According to the documentation for the innodb_buffer_pool_size, the number is in bytes.  The script is writing MB (it divides the memory size KB by 1024 to get to MB).\r\n\r\nOn a 4GB memory server, it is writing 2867 which is below the minimum of 5242880.  The default value for this field is 128MB (134217728).\r\n\r\nExamining the docker log shows that the size is the minimum value\r\n\r\n2016-05-23 15:59:05 39336 [Note] InnoDB: Initializing buffer pool, size = 5M\r\n\r\nAn alternative would be to change the my.cnf.tmpl file to specify the substitution like so to include the units:\r\n`innodb_buffer_pool_size = ${buffer}M`\r\n\r\nhttps://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size\r\n\r\nfrom manage.py:\r\n```\r\n        # replace innodb_buffer_pool_size value from environment\r\n        # or use a sensible default (70% of available physical memory)\r\n        innodb_buffer_pool_size = int(get_environ('INNODB_BUFFER_POOL_SIZE', 0))\r\n        if not innodb_buffer_pool_size:\r\n            with open('/proc/meminfo', 'r') as memInfoFile:\r\n                memInfo = memInfoFile.read()\r\n                base = re.search(r'^MemTotal: *(\\d+)', memInfo).group(1)\r\n                innodb_buffer_pool_size = int((int(base) / 1024) * 0.7)\r\n\r\n        # replace server-id with ID derived from hostname\r\n        # ref https://dev.mysql.com/doc/refman/5.7/en/replication-configuration.html\r\n        hostname = socket.gethostname()\r\n        server_id = int(str(hostname)[:4], 16)\r\n\r\n        with open('/etc/my.cnf.tmpl', 'r') as f:\r\n            template = string.Template(f.read())\r\n            rendered = template.substitute(buffer=innodb_buffer_pool_size,\r\n                                           server_id=server_id,\r\n                                           hostname=hostname)\r\n```"},"comment":{"url":"https://api.github.com/repos/autopilotpattern/mysql/issues/comments/221025431","html_url":"https://github.com/autopilotpattern/mysql/issues/32#issuecomment-221025431","issue_url":"https://api.github.com/repos/autopilotpattern/mysql/issues/32","id":221025431,"user":{"login":"headw01","id":5651137,"avatar_url":"https://avatars.githubusercontent.com/u/5651137?v=3","gravatar_id":"","url":"https://api.github.com/users/headw01","html_url":"https://github.com/headw01","followers_url":"https://api.github.com/users/headw01/followers","following_url":"https://api.github.com/users/headw01/following{/other_user}","gists_url":"https://api.github.com/users/headw01/gists{/gist_id}","starred_url":"https://api.github.com/users/headw01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headw01/subscriptions","organizations_url":"https://api.github.com/users/headw01/orgs","repos_url":"https://api.github.com/users/headw01/repos","events_url":"https://api.github.com/users/headw01/events{/privacy}","received_events_url":"https://api.github.com/users/headw01/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T16:35:35Z","updated_at":"2016-05-23T16:35:35Z","body":"Something is odd with the issue system at the moment it appears... I created a 'duplicate' issue for this one as it was showing a 404 error when created initially."}}
{"actor":{"display_login":"headw01"}}