scaleway / kernel-tools

:penguin: Kernels on Scaleway
http://devhub.scaleway.com/#/bootscripts
MIT License
104 stars 36 forks source link

Problems with LogStach #335

Closed fxthiry closed 7 years ago

fxthiry commented 7 years ago

Hello,

LogStach need CONFIG_CFS_BANDWIDTH to be enabled to work properly.

[2017-02-11T18:53:00,241][DEBUG][logstash.instrument.periodicpoller.cgroup] Error, cannot retrieve cgroups information {:exception=>"Errno::ENOENT", :message=>"No such file or directory - /sys/fs/cgroup/cpuacct/cpu.cfs_period_us"}

kernel-tools/x86_64/4.8.14-std/.config

CONFIG_CFS_BANDWIDTH is not set

Would you consider enabling CONFIG_CFS_BANDWIDTH ? :)

gnh1201 commented 7 years ago

I was apply this solution (use fake cgroup):

root@scw-56b121:~# cd /usr/share/logstash root@scw-56b121:/usr/share/logstash# nano ./logstash-core/lib/logstash/instrument/periodic_poller/cgroup.rb

ADD PROC_CGROUP_FAKE_CPU_DIR = Pathname.new("/opt/fake-cgroup/cpu") ADD PROC_CGROUP_FAKE_CPUACCT_DIR = Pathname.new("/opt/fake-cgroup/cpuacct") MODIFY PROC_CGROUP_CPU_DIR PROC_CGROUP_FAKE_CPU_DIR MODIFY PROC_CGROUP_CPUACCT_DIR PROC_CGROUP_FAKE_CPUACCT_DIR

root@scw-56b121:/usr/share/logstash# mkdir /opt/fake-cgroup/ root@scw-56b121:/usr/share/logstash# mkdir /opt/fake-cgroup/cpuacct root@scw-56b121:/usr/share/logstash# echo '250000' > /opt/fake-cgroup/cpuacct/cpu.cfs_period_us root@scw-56b121:/usr/share/logstash# echo '250000' > /opt/fake-cgroup/cpuacct/cpu.cfs_quota_us root@scw-56b121:/usr/share/logstash# nano ./logstash-core/lib/logstash/instrument/periodic_poller/cgroup.rb root@scw-56b121:/usr/share/logstash# mkdir /opt/fake-cgroup/cpu root@scw-56b121:/usr/share/logstash# ln -s /sys/fs/cgroup/cpu,cpuacct/cpuacct.stat /opt/fake-cgroup/cpu/cpu.stat root@scw-56b121:/usr/share/logstash# service logstash restart

reference: https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt

Error is solved. but, result is unlimited loop '[DEBUG][logstash.pipeline] Pushing flush onto pipeline'

output not working. https://github.com/elastic/logstash/issues/7928

tbillon commented 7 years ago

CONFIG_CFS_BANDWIDTH is now enable in all kernels. Please update your bootscript if you need it.