Skip to content
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

JSON syslog output very high CPU percentage #18472

Merged
merged 1 commit into from Aug 24, 2023

Conversation

lsayanes
Copy link
Contributor

Related issue
#18471

Description

This PR fixes high CPU usage of 100-90% when setting JSON syslog_output

Fix:
just wait when there is nothing to send in src/os_csyslogd/csyslogd.c:

        if (al_data == NULL && json_data == NULL) { 
            sleep(1);
        }

fixed

Configuration example

<syslog_output>
    <server>10.211.55.7</server>
    <level>7</level>
    <format>json</format>
</syslog_output>

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X
  • Source installation
  • Package installation
  • Source upgrade
  • Package upgrade
  • Review logs syntax and correct language
  • QA templates contemplate the added capabilities
  • Memory tests for Linux
    • Scan-build report
    • Coverity
    • Valgrind (memcheck and descriptor leaks check)
    • Dr. Memory
    • AddressSanitizer
  • Memory tests for Windows
    • Scan-build report
    • Coverity
    • Dr. Memory
  • Memory tests for macOS
    • Scan-build report
    • Leaks
    • AddressSanitizer
  • Retrocompatibility with older Wazuh versions
  • Working on cluster environments
  • Configuration on demand reports new parameters
  • The data flow works as expected (agent-manager-api-app)
  • Added unit tests (for new features)
  • Stress test for affected components
  • Decoder/Rule tests
    • Added unit testing files ".ini"
    • runtests.py executed without errors

@lsayanes lsayanes changed the base branch from master to 4.5.2 August 17, 2023 19:40
@lsayanes lsayanes force-pushed the 18471-JSON-syslog_output-high-CPU-percentage branch from 1c08c86 to 35ae85f Compare August 17, 2023 19:45
@MarcelKemp MarcelKemp linked an issue Aug 21, 2023 that may be closed by this pull request
@lsayanes lsayanes force-pushed the 18471-JSON-syslog_output-high-CPU-percentage branch from c4a4431 to 35ae85f Compare August 24, 2023 16:50
@Dwordcito Dwordcito merged commit 1731372 into 4.5.2 Aug 24, 2023
68 checks passed
@Dwordcito Dwordcito deleted the 18471-JSON-syslog_output-high-CPU-percentage branch August 24, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON syslog output very high CPU percentage
3 participants