| 511 | |
| 512 | = munin plugin = |
| 513 | * github:vajtsz/munin-plugins |
| 514 | |
| 515 | == lxc_proc == |
| 516 | * github:vajtsz/munin-plugins/blob/6a426b4bde7addcaf42d72a033e713d0f11776c0/squeeze/lxc_proc |
| 517 | * Debian Squeezeと異なり、Ubuntu 12.04では{{{lxc-cgroup -t container_name tasks}}}が使えない |
| 518 | |
| 519 | === Debian 6.0 === |
| 520 | * http://wiki.debian.org/LXC |
| 521 | > Add this line to /etc/fstab |
| 522 | > {{{ |
| 523 | > cgroup /sys/fs/cgroup cgroup defaults 0 0 |
| 524 | > }}} |
| 525 | > Try to mount it (a reboot solves an eventual "resource busy problem" in any case) |
| 526 | > {{{ |
| 527 | > mount /sys/fs/cgroup |
| 528 | > }}} |
| 529 | |
| 530 | * $ sudo lxc-start -d -n lxc-test |
| 531 | * $ ls -1F /sys/fs/cgroup/ |
| 532 | {{{ |
| 533 | cgroup.procs |
| 534 | cpuacct.stat |
| 535 | cpuacct.usage |
| 536 | cpuacct.usage_percpu |
| 537 | cpuset.cpu_exclusive |
| 538 | cpuset.cpus |
| 539 | cpuset.mem_exclusive |
| 540 | cpuset.mem_hardwall |
| 541 | cpuset.memory_migrate |
| 542 | cpuset.memory_pressure |
| 543 | cpuset.memory_pressure_enabled |
| 544 | cpuset.memory_spread_page |
| 545 | cpuset.memory_spread_slab |
| 546 | cpuset.mems |
| 547 | cpuset.sched_load_balance |
| 548 | cpuset.sched_relax_domain_level |
| 549 | cpu.shares |
| 550 | devices.allow |
| 551 | devices.deny |
| 552 | devices.list |
| 553 | lxc-test/ |
| 554 | net_cls.classid |
| 555 | notify_on_release |
| 556 | release_agent |
| 557 | tasks |
| 558 | }}} |
| 559 | * /sys/fs/cgroup/lxc-test/ も同じ構造 |
| 560 | * $ sudo lxc-cgroup -n lxc-test tasks |
| 561 | {{{ |
| 562 | 1432 |
| 563 | 1569 |
| 564 | 1571 |
| 565 | 1598 |
| 566 | }}} |
| 567 | |
| 568 | === Ubuntu 12.04 === |
| 569 | * Ubuntu 12.04 with {{{aptitude install -R lxc}}} |
| 570 | * cgroup関係のパッケージは{{{-R}}}をつけるとインストールされない |
| 571 | |
| 572 | |
| 573 | * Ubuntu 12.04 with /etc/fstab:{{{cgroup /sys/fs/cgroup cgroup defaults 0 0}}} |
| 574 | * 起動時に自動でマウントされないため、{{{mount -a}}}する必要がある |
| 575 | * $ sudo mount -a |
| 576 | * $ ls -1F /sys/fs/cgroup/ |
| 577 | {{{ |
| 578 | blkio.io_merged |
| 579 | blkio.io_queued |
| 580 | blkio.io_service_bytes |
| 581 | blkio.io_serviced |
| 582 | blkio.io_service_time |
| 583 | blkio.io_wait_time |
| 584 | blkio.reset_stats |
| 585 | blkio.sectors |
| 586 | blkio.throttle.io_service_bytes |
| 587 | blkio.throttle.io_serviced |
| 588 | blkio.throttle.read_bps_device |
| 589 | blkio.throttle.read_iops_device |
| 590 | blkio.throttle.write_bps_device |
| 591 | blkio.throttle.write_iops_device |
| 592 | mitty@lein:~$ ls -1F /sys/fs/cgroup/ |
| 593 | blkio.io_merged |
| 594 | blkio.io_queued |
| 595 | blkio.io_service_bytes |
| 596 | blkio.io_serviced |
| 597 | blkio.io_service_time |
| 598 | blkio.io_wait_time |
| 599 | blkio.reset_stats |
| 600 | blkio.sectors |
| 601 | blkio.throttle.io_service_bytes |
| 602 | blkio.throttle.io_serviced |
| 603 | blkio.throttle.read_bps_device |
| 604 | blkio.throttle.read_iops_device |
| 605 | blkio.throttle.write_bps_device |
| 606 | blkio.throttle.write_iops_device |
| 607 | blkio.time |
| 608 | blkio.weight |
| 609 | blkio.weight_device |
| 610 | cgroup.clone_children |
| 611 | cgroup.event_control |
| 612 | cgroup.procs |
| 613 | cpuacct.stat |
| 614 | cpuacct.usage |
| 615 | cpuacct.usage_percpu |
| 616 | cpu.cfs_period_us |
| 617 | cpu.cfs_quota_us |
| 618 | cpu.rt_period_us |
| 619 | cpu.rt_runtime_us |
| 620 | cpuset.cpu_exclusive |
| 621 | cpuset.cpus |
| 622 | cpuset.mem_exclusive |
| 623 | cpuset.mem_hardwall |
| 624 | cpuset.memory_migrate |
| 625 | cpuset.memory_pressure |
| 626 | cpuset.memory_pressure_enabled |
| 627 | cpuset.memory_spread_page |
| 628 | cpuset.memory_spread_slab |
| 629 | cpuset.mems |
| 630 | cpuset.sched_load_balance |
| 631 | cpuset.sched_relax_domain_level |
| 632 | cpu.shares |
| 633 | cpu.stat |
| 634 | devices.allow |
| 635 | devices.deny |
| 636 | devices.list |
| 637 | lxc/ |
| 638 | memory.failcnt |
| 639 | memory.force_empty |
| 640 | memory.limit_in_bytes |
| 641 | memory.max_usage_in_bytes |
| 642 | memory.memsw.failcnt |
| 643 | memory.memsw.limit_in_bytes |
| 644 | memory.memsw.max_usage_in_bytes |
| 645 | memory.memsw.usage_in_bytes |
| 646 | memory.move_charge_at_immigrate |
| 647 | memory.numa_stat |
| 648 | memory.oom_control |
| 649 | memory.soft_limit_in_bytes |
| 650 | memory.stat |
| 651 | memory.swappiness |
| 652 | memory.usage_in_bytes |
| 653 | memory.use_hierarchy |
| 654 | notify_on_release |
| 655 | release_agent |
| 656 | tasks |
| 657 | }}} |
| 658 | * /sys/fs/cgroup/lxc/, /sys/fs/cgroup/lxc/lxc-test/ も同じ構造 |
| 659 | * $ sudo lxc-cgroup -n lxc-test tasks |
| 660 | {{{ |
| 661 | lxc-cgroup: cgroup is not mounted |
| 662 | lxc-cgroup: failed to retrieve value of 'tasks' for 'lxc-test' |
| 663 | }}} |
| 664 | * $ cat /sys/fs/cgroup/lxc/lxc-test/tasks |
| 665 | {{{ |
| 666 | 2712 |
| 667 | 2867 |
| 668 | 2932 |
| 669 | 2943 |
| 670 | 2947 |
| 671 | 2952 |
| 672 | 2953 |
| 673 | 2954 |
| 674 | 2983 |
| 675 | 3002 |
| 676 | 3031 |
| 677 | 3036 |
| 678 | 3037 |
| 679 | 3042 |
| 680 | 3056 |
| 681 | 3058 |
| 682 | }}} |