-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new(config): add falco_libs.thread_table_size
#3071
Conversation
/milestone 0.38.0 |
# and the fields called `n_drops_full_threadtable` or `n_store_evts_drops` will inform you | ||
# if you should increase this value for optimal performance. | ||
state_engine: | ||
thread_table_size: 262144 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FedeDP and @jasondellaluce since you reviewed the libs changes. Thank you!
e7db2f9
to
d5db824
Compare
userspace/falco/configuration.cpp
Outdated
@@ -63,6 +63,7 @@ falco_configuration::falco_configuration(): | |||
m_syscall_evt_drop_max_burst(1), | |||
m_syscall_evt_simulate_drops(false), | |||
m_syscall_evt_timeout_max_consecutives(1000), | |||
m_state_engine_thread_table_size(262144), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a macro for the default value? Given it is a "weird" number used twice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, funny enough if you search that number in the Linux kernel it is not so odd.
Before I re-push, was wondering about the Windows build failure. is there something in libs that needs to be adjusted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was wondering about the Windows build failure. is there something in libs that needs to be adjusted?
Don't really know why it is complaining :/
jsoncpp.lib(json_value.obj) : error LNK2019: unresolved external symbol __imp_modf referenced in function "public: bool __cdecl Json::Value::isInt64(void)const " (?isInt64@Value@Json@@QEBA_NXZ) [D:\a\falco\falco\build\libsinsp\examples\sinsp-example.vcxproj]
jsoncpp.lib(json_writer.obj) : error LNK2019: unresolved external symbol __imp__finite referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Json::`anonymous namespace'::valueToString(double,bool,unsigned int,enum Json::PrecisionType)" (?valueToString@?A0x7fc2ca38@Json@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@N_NIW4PrecisionType@2@@Z) [D:\a\falco\falco\build\libsinsp\examples\sinsp-example.vcxproj]
jsoncpp.lib(json_writer.obj) : error LNK2019: unresolved external symbol __imp__isnan referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Json::`anonymous namespace'::valueToString(double,bool,unsigned int,enum Json::PrecisionType)" (?valueToString@?A0x7fc2ca38@Json@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@N_NIW4PrecisionType@2@@Z) [D:\a\falco\falco\build\libsinsp\examples\sinsp-example.vcxproj]
Seems a libs issue on jsoncpp; perhaps triggered by: falcosecurity/libs@a89fd5d
cc @geraldcombs can you take a look? 🙏 thanks!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could write it as 0x40000
so it's easier to understand. Not sure if you can do the same in yaml as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a libs issue on jsoncpp
It might be because libs is linking with the dynamic CRT (MultiThreadedDLL) instead of the static one (MultiThreaded). If that's the case we should be able to fix it here by passing -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
to CMake in the build-win32-package
job, similar to the build-libs-others-amd64
job in libs.
Alternatively we could try to fix it in libs, e.g. by trying to override CMAKE_MSVC_RUNTIME_LIBRARY in CMakeLists.txt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geraldcombs whichever you think is the best approach. I can bump libs here to the new latest after we address it in libs if we choose that path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LucaGuerra internally yes we can default to 0x40000 in the macro, but don't you think for adopters that is even more weird than a normal number? 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geraldcombs whichever you think is the best approach. I can bump libs here to the new latest after we address it in libs if we choose that path.
I opened a libs PR (1695) to link to the static CRT by default. That seemed to make the most sense, since the project favors static builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought after a quick look.
I would like to group some top-level config keys instead of continuously adding new ones.
I mean, the top-level config keys are growing exponentially, and this may not be ideal for users approaching the configuration.
What would it be? It seems that we don't have a new top level category for |
maybe we could add a key called |
@Andreagit97 that's a great idea actually, even if it is exposing some "internal knowledge" about who owns what. |
Additional question: Do we know what's wrong with the Windows build? |
Yep, we need to use the underscore |
In general, I wouldn't say I like the idea of exposing internal names to the users (because internals can change, but the external function remains the same). So perhaps something like However, |
d5db824
to
f1da096
Compare
falco_libs_internals.thread_table_size
@geraldcombs using the latest libs commit and also rebased w/ falco master, still having the windows failure. Could you take another look? Thank you! |
I'm able to replicate the issue here. If I make the following change here
I can build and run |
Thanks @geraldcombs I'll then rebase, thanks! |
@geraldcombs just double-checking if I interpret this correctly. You or someone else will open a PR and I shall rebase afterwards? Thanks in advance for clarifying! |
f1da096
to
1a6f4c1
Compare
This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped. Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION. /hold |
@jasondellaluce already bumped libs before hence I could remove it here. However, the CI still seems to be in a not good state (unrelated to these changes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@incertum I have no major concerns here if not the naming decision, as pointed out above. I'm pretty much onboard with the suggestions of the other reviewers.
userspace/engine/falco_common.h
Outdated
@@ -28,6 +28,8 @@ limitations under the License. | |||
// | |||
#define DEFAULT_OUTPUTS_QUEUE_CAPACITY_UNBOUNDED_MAX_LONG_VALUE std::ptrdiff_t(~size_t(0) / 2) | |||
|
|||
#define DEFAULT_FALCO_LIBS_INTERNALS_THREAD_TABLE_SIZE 0x4000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be 0x40000
? Seems like this is a quite smaller number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhm yeah you see hey @LucaGuerra I reverted to the human readable value, less prone to such issues.
1a6f4c1
to
e17c886
Compare
@jasondellaluce Could you elaborate? I tried to pick a name that addresses all feedback. If this should not be it, what should the final name be? No strong opinion. |
I think I'd go with either |
After thinking about this again, I believe |
e17c886
to
14b3364
Compare
falco_libs_internals.thread_table_size
falco_libs.thread_table_size
SGTM, just changed it. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
LGTM label has been added. Git tree hash: 2a6cb1f153d2edb03f88bba04b0f167decafb967
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a minor nit and then we can go! thank you!
userspace/falco/configuration.h
Outdated
@@ -136,6 +136,8 @@ class falco_configuration | |||
|
|||
uint32_t m_syscall_evt_timeout_max_consecutives; | |||
|
|||
std::uint32_t m_falco_libs_thread_table_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::uint32_t m_falco_libs_thread_table_size; | |
uint32_t m_falco_libs_thread_table_size; |
Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
14b3364
to
b635f79
Compare
LGTM label has been added. Git tree hash: 8be4088d216f0f73aa595b0db4a073ca47c744dd
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP, incertum, leogr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
We recently increased the default threadtable size to accommodate modern infrastructures better as we have observed drops related to a full internal thread table. This PR makes this setting configurable by the end user.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: