{"action":"created","issue":{"url":"https://api.github.com/repos/emqtt/emqttd/issues/1144","repository_url":"https://api.github.com/repos/emqtt/emqttd","labels_url":"https://api.github.com/repos/emqtt/emqttd/issues/1144/labels{/name}","comments_url":"https://api.github.com/repos/emqtt/emqttd/issues/1144/comments","events_url":"https://api.github.com/repos/emqtt/emqttd/issues/1144/events","html_url":"https://github.com/emqtt/emqttd/issues/1144","id":241580254,"number":1144,"title":"Improve systemd unit file","user":{"login":"workingegg","id":24775470,"avatar_url":"https://avatars2.githubusercontent.com/u/24775470?v=4","gravatar_id":"","url":"https://api.github.com/users/workingegg","html_url":"https://github.com/workingegg","followers_url":"https://api.github.com/users/workingegg/followers","following_url":"https://api.github.com/users/workingegg/following{/other_user}","gists_url":"https://api.github.com/users/workingegg/gists{/gist_id}","starred_url":"https://api.github.com/users/workingegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workingegg/subscriptions","organizations_url":"https://api.github.com/users/workingegg/orgs","repos_url":"https://api.github.com/users/workingegg/repos","events_url":"https://api.github.com/users/workingegg/events{/privacy}","received_events_url":"https://api.github.com/users/workingegg/received_events","type":"User","site_admin":false},"labels":[{"id":22388526,"url":"https://api.github.com/repos/emqtt/emqttd/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":{"login":"turtleDeng","id":1830077,"avatar_url":"https://avatars2.githubusercontent.com/u/1830077?v=4","gravatar_id":"","url":"https://api.github.com/users/turtleDeng","html_url":"https://github.com/turtleDeng","followers_url":"https://api.github.com/users/turtleDeng/followers","following_url":"https://api.github.com/users/turtleDeng/following{/other_user}","gists_url":"https://api.github.com/users/turtleDeng/gists{/gist_id}","starred_url":"https://api.github.com/users/turtleDeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtleDeng/subscriptions","organizations_url":"https://api.github.com/users/turtleDeng/orgs","repos_url":"https://api.github.com/users/turtleDeng/repos","events_url":"https://api.github.com/users/turtleDeng/events{/privacy}","received_events_url":"https://api.github.com/users/turtleDeng/received_events","type":"User","site_admin":false},"assignees":[{"login":"turtleDeng","id":1830077,"avatar_url":"https://avatars2.githubusercontent.com/u/1830077?v=4","gravatar_id":"","url":"https://api.github.com/users/turtleDeng","html_url":"https://github.com/turtleDeng","followers_url":"https://api.github.com/users/turtleDeng/followers","following_url":"https://api.github.com/users/turtleDeng/following{/other_user}","gists_url":"https://api.github.com/users/turtleDeng/gists{/gist_id}","starred_url":"https://api.github.com/users/turtleDeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtleDeng/subscriptions","organizations_url":"https://api.github.com/users/turtleDeng/orgs","repos_url":"https://api.github.com/users/turtleDeng/repos","events_url":"https://api.github.com/users/turtleDeng/events{/privacy}","received_events_url":"https://api.github.com/users/turtleDeng/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/emqtt/emqttd/milestones/102","html_url":"https://github.com/emqtt/emqttd/milestone/102","labels_url":"https://api.github.com/repos/emqtt/emqttd/milestones/102/labels","id":2628740,"number":102,"title":"2.3-beta.1","description":"","creator":{"login":"huangdan","id":970300,"avatar_url":"https://avatars1.githubusercontent.com/u/970300?v=4","gravatar_id":"","url":"https://api.github.com/users/huangdan","html_url":"https://github.com/huangdan","followers_url":"https://api.github.com/users/huangdan/followers","following_url":"https://api.github.com/users/huangdan/following{/other_user}","gists_url":"https://api.github.com/users/huangdan/gists{/gist_id}","starred_url":"https://api.github.com/users/huangdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huangdan/subscriptions","organizations_url":"https://api.github.com/users/huangdan/orgs","repos_url":"https://api.github.com/users/huangdan/repos","events_url":"https://api.github.com/users/huangdan/events{/privacy}","received_events_url":"https://api.github.com/users/huangdan/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":10,"state":"closed","created_at":"2017-07-08T09:18:10Z","updated_at":"2017-07-26T05:20:00Z","due_on":"2017-07-14T07:00:00Z","closed_at":"2017-07-26T03:09:18Z"},"comments":2,"created_at":"2017-07-10T02:03:46Z","updated_at":"2017-07-26T05:20:00Z","closed_at":"2017-07-26T05:20:00Z","body":"#### Environment\r\n\r\n- OS: CentOS 7\r\n- Erlang/OTP: 19\r\n- EMQ: 2.1.0 and 2.2.0-rc2\r\n\r\n#### Description\r\n\r\neMQTT supports built-in systemd unit structure since v2.2-rc1, and I have tried to do this on 2.1.0 and which works fine.\r\n\r\nAfter checking the systemd unit file on v2.2-rc2, I found that you've missed something that is important to the performance, the nofile limit of the process started by systemd will not load the same configuration as you set by ulimit.\r\n\r\nAs the result, it will run in the default value 1024 as soft limit, and 4096 as hard limit.\r\nSo, to improve that you have to assign value to `LimitNOFILE` directive in the systemd unit file, such as:\r\n```\r\n[Unit]\r\nDescription=emqtt daemon\r\nAfter=network.target\r\n\r\n[Service]\r\nType=forking\r\nEnvironment=HOME=/root\r\nRestart=always\r\nExecStart=/bin/sh /root/emqttd/bin/emqttd start\r\nLimitNOFILE=1048576\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n```\r\n\r\nHope this will help."},"comment":{"url":"https://api.github.com/repos/emqtt/emqttd/issues/comments/317950560","html_url":"https://github.com/emqtt/emqttd/issues/1144#issuecomment-317950560","issue_url":"https://api.github.com/repos/emqtt/emqttd/issues/1144","id":317950560,"user":{"login":"emqplus","id":11869,"avatar_url":"https://avatars0.githubusercontent.com/u/11869?v=4","gravatar_id":"","url":"https://api.github.com/users/emqplus","html_url":"https://github.com/emqplus","followers_url":"https://api.github.com/users/emqplus/followers","following_url":"https://api.github.com/users/emqplus/following{/other_user}","gists_url":"https://api.github.com/users/emqplus/gists{/gist_id}","starred_url":"https://api.github.com/users/emqplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emqplus/subscriptions","organizations_url":"https://api.github.com/users/emqplus/orgs","repos_url":"https://api.github.com/users/emqplus/repos","events_url":"https://api.github.com/users/emqplus/events{/privacy}","received_events_url":"https://api.github.com/users/emqplus/received_events","type":"User","site_admin":false},"created_at":"2017-07-26T05:20:00Z","updated_at":"2017-07-26T05:20:00Z","body":"@workingegg Thanks for you contribution. I will close the issue now."}}
{"actor":{"display_login":"emqplus"}}