Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2k stars 574 forks source link

[dev.icinga.com #6566] CIB::CalculateServiceStats should be cached #1732

Closed icinga-migration closed 7 years ago

icinga-migration commented 10 years ago

This issue has been migrated from Redmine: https://dev.icinga.com/issues/6566

Created by gbeutner on 2014-06-24 09:10:39 +00:00

Assignee: (none) Status: Closed (closed on 2016-12-07 22:03:35 +00:00) Target Version: (none) Last Update: 2016-12-07 22:03:35 +00:00 (in Redmine)

Icinga Version: 2.0.0

Icinga is using 3200% CPU time. Most of its threads are in:

(gdb) bt

#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1  0x00007f751d047339 in _L_lock_926 () from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007f751d04715b in __pthread_mutex_lock (mutex=0xd0f098) at pthread_mutex_lock.c:61
#3  0x000000000042d268 in boost::unique_lock::lock (this=0x7f750b5d4cd8) at /usr/include/boost/thread/pthread/mutex.hpp:59
#4  0x00007f751cd56721 in Lock (this=, this=) at /usr/include/boost/thread/locks.hpp:289
#5  icinga::ObjectLock::ObjectLock (this=, object=...) at /home/gbeutner/.ccache/tmp/objectlock.tmp.gbeutner-dev.dev.netways.de.22422.ii:38
#6  0x00007f75193304ba in icinga::DynamicTypeIterator::equal (this=, other=...) at /home/gbeutner/icinga2/lib/base/dynamictype.hpp:119
#7  0x00007f751934189c in icinga::CIB::CalculateServiceStats () at /home/gbeutner/icinga2/lib/icinga/cib.cpp:178
#8  0x00007f75193b8bba in icinga::IcingaApplication::ResolveMacro (this=, macro=..., result=) at /home/gbeutner/icinga2/lib/icinga/icingaapplication.cpp:182
#9  0x00007f75193b9a19 in non-virtual thunk to icinga::IcingaApplication::ResolveMacro(icinga::String const&, boost::shared_ptr const&, icinga::String*) const ()

at /home/gbeutner/icinga2/lib/icinga/icingaapplication.cpp:155

#10 0x00007f75193cad54 in icinga::MacroProcessor::ResolveMacro (macro=..., resolvers=, cr=..., result=, 

recursive_macro=) at /home/gbeutner/icinga2/lib/icinga/macroprocessor.cpp:101

#11 0x00007f75193ca0b1 in icinga::MacroProcessor::InternalResolveMacros(icinga::String const&, std::vector >, std::allocator > > > const&, boost::shared_ptr const&, icinga::String*, boost::function const&, int) (str=..., resolvers=..., 

cr=..., missingMacro=, escapeFn=..., recursionLevel=) at /home/gbeutner/icinga2/lib/icinga/macroprocessor.cpp:176

#12 0x00007f75193c93b8 in icinga::MacroProcessor::ResolveMacros(icinga::Value const&, std::vector >, std::allocator > > > const&, boost::shared_ptr const&, icinga::String*, boost::function const&) (str=..., 

resolvers=<error reading variable: Unhandled dwarf expression opcode 0x0>, cr=..., missingMacro=, escapeFn=...) at /home/gbeutner/icinga2/lib/icinga/macroprocessor.cpp:45

#13 0x00007f75193e823a in icinga::PluginUtility::ExecuteCommand(boost::shared_ptr const&, boost::shared_ptr const&, boost::shared_ptr const&, std::vector >, std::allocator > > > const&, boost::function const&) (commandObj=..., checkable=..., cr=..., macroResolvers=..., callback=)

at /home/gbeutner/icinga2/lib/icinga/pluginutility.cpp:71

#14 0x00007f7518ad7b3c in icinga::PluginCheckTask::ScriptFunc (checkable=..., cr=) at /home/gbeutner/icinga2/lib/methods/pluginchecktask.cpp:53
#15 0x00007f7518ace397 in icinga::ScriptFunctionWrapperV const&, boost::shared_ptr const&> (

function=<error reading variable: Unhandled dwarf expression opcode 0x95>, arguments=<error reading variable: Unhandled dwarf expression opcode 0x95>) at /home/gbeutner/icinga2/lib/base/scriptfunctionwrapper.hpp:88

#16 0x00007f7518ace9a5 in operator() (f=, this=, f=, a=...) at /usr/include/boost/bind/bind.hpp:303
#17 operator() (a1=..., this=, a1=...) at /home/gbeutner/.ccache/tmp/clusterche.tmp.gbeutner-dev.dev.netways.de.4689.ii:47
#18 boost::detail::function::function_obj_invoker1 const&, boost::shared_ptr const&), std::vector > const&), boost::_bi::list2 const&, boost::shared_ptr const&)>, boost::arg<1> > >, icinga::Value, std::vector > const&>::invoke (function_obj_ptr=..., a0=...)

at /home/gbeutner/.ccache/tmp/clusterche.tmp.gbeutner-dev.dev.netways.de.4689.ii:132

#19 0x00007f751cd602cb in icinga::ScriptFunction::Invoke (this=, arguments=...) at /usr/include/boost/function/function_template.hpp:759
#20 0x00007f751cd3f53d in icinga::DynamicObject::InvokeMethod (this=, method=..., arguments=...) at /home/gbeutner/icinga2/lib/base/dynamicobject.cpp:227
#21 0x00007f751933c93c in icinga::CheckCommand::Execute (this=, checkable=..., cr=...) at /home/gbeutner/icinga2/lib/icinga/checkcommand.cpp:32
#22 0x00007f7519401202 in icinga::Checkable::ExecuteCheck (this=) at /home/gbeutner/icinga2/lib/icinga/checkable-check.cpp:486
#23 0x00007f751886fe3a in icinga::CheckerComponent::ExecuteCheckHelper (this=0x7f74fc1a1a90, checkable=...) at /home/gbeutner/icinga2/components/checker/checkercomponent.cpp:196
#24 0x00007f751cd8756f in icinga::ThreadPool::WorkerThread::ThreadProc (this=, queue=...) at /usr/include/boost/function/function_template.hpp:759
#25 0x00007f751d458629 in ?? () from /usr/lib/libboost_thread.so.1.49.0
#26 0x00007f751d044b50 in start_thread (arg=) at pthread_create.c:304
#27 0x00007f751b0bc0ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#28 0x0000000000000000 in ?? ()

(gdb)

icinga-migration commented 10 years ago

Updated by mfriedrich on 2014-07-09 15:04:33 +00:00

icinga-migration commented 10 years ago

Updated by gbeutner on 2014-07-11 08:42:22 +00:00

icinga-migration commented 9 years ago

Updated by mfriedrich on 2015-06-26 09:15:07 +00:00

icinga-migration commented 9 years ago

Updated by mfriedrich on 2015-08-06 20:33:40 +00:00

icinga-migration commented 7 years ago

Updated by mfriedrich on 2016-12-07 22:03:35 +00:00

We know why, and if we ever think about it again, we may just do it. But not in this ticket. See ya.