{"id":17470752,"url":"https://github.com/matsumotory/mruby-rcon","last_synced_at":"2025-04-30T08:24:45.689Z","repository":{"id":140250472,"uuid":"46832411","full_name":"matsumotory/mruby-rcon","owner":"matsumotory","description":"lightweight virtualization tool for linux processes module for mruby","archived":false,"fork":false,"pushed_at":"2018-11-14T03:20:00.000Z","size":9,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T14:23:34.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matsumotory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-11-25T02:31:36.000Z","updated_at":"2025-02-06T04:46:11.000Z","dependencies_parsed_at":"2024-02-04T21:08:57.346Z","dependency_job_id":"8afbd5ec-5187-4438-a0f2-68d8e4c7011c","html_url":"https://github.com/matsumotory/mruby-rcon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-rcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-rcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-rcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-rcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matsumotory","download_url":"https://codeload.github.com/matsumotory/mruby-rcon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251667551,"owners_count":21624522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T16:08:15.979Z","updated_at":"2025-04-30T08:24:45.658Z","avatar_url":"https://github.com/matsumotory.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mruby-rcon\n\nmruby-rcon is a lightweight virtualization mrbgem for linux processes.\n\n## build rcon\n```\nrake\n```\n\nand create `rcon` binary into current directory.\n\n## example\n```ruby\n# httpd.rb\nRcon.new({\n\n  :command =\u003e \"/usr/sbin/httpd -X\",\n\n  :resource =\u003e {\n\n    # cgroup name\n    :group =\u003e \"httpd\",\n\n    # cgroup root path\n    # centos \"/cgroup\" by default\n    # ubuntu \"/sys/fs/cgroup\"\n    :root =\u003e \"/cgroup\"\n\n    # CPU [msec] exc: 30000 -\u003e 30%\n    :cpu_quota =\u003e 30000,\n\n    # IO [Bytes/sec]\n    :blk_dvnd =\u003e \"202:0\",\n    :blk_rbps =\u003e 10485760,\n    :blk_wbps =\u003e 10485760,\n\n    # Memory [Bytes]\n    :mem =\u003e 512 * 1024 * 1024,\n    :oom =\u003e true,\n\n  },\n\n}).run\n# callback memory limit event (default :oom)\n# }).run_with_mem_eventfd do |ret|\n#   puts \"OOM KILLER!!! \u003e #{ret}\"\n# end\n\n# callback memory limit event for oom\n# }).run_with_mem_eventfd(:oom) do |ret|\n#   puts \"OOM KILLER!!! \u003e #{ret}\"\n# end\n\n# callback memory limit event for usage(4MByte)\n# }).run_with_mem_eventfd(:usage, 4 * 1024 * 1024) do |ret|\n#   puts \"Usage Up or Down to threadshould !!! \u003e #{ret}\"\n# end\n\n```\n\n## run\n```\nsudo ./rcon httpd.rb\n```\n\n### auto memory expansion example\n```ruby\nVirtualing.new({\n#(snip)\n  :resource =\u003e {\n    #(snip)\n    :oom =\u003e false,\n  },\n#(snip)\n}).run_with_mem_eventfd_loop do |ret|\n  puts \"OOM KILLER!!! current memory: #{mem}\"\n  sleep 2\n  c = Virtualing::MEMORY.new group\n  mem = mem * 2\n  c.limit_in_bytes = mem\n  c.modify\n  puts \"current memory expand to #{mem}\"\nend\n```\n\n## License\nunder the MIT License:\n- see LICENSE file\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatsumotory%2Fmruby-rcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatsumotory%2Fmruby-rcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatsumotory%2Fmruby-rcon/lists"}