Skip to content

Disable logging of conntrack stats traffic - #6738

Closed
ghost wants to merge 1 commit into
4.18from
unknown repository
Closed

ghost wants to merge 1 commit into
4.18from
unknown repository

Conversation

@ghost

@ghost ghost commented Sep 14, 2022

Copy link
Copy Markdown

Description

Fixes: #6718

Changes the default behavior of conntrackd to stop logging verbose conntrack-ed traffic to /var/log/daemon.log. This is expensive in terms of performance and also costly in terms of the limited disk capacity in a VR. In cases of large quantities of traffic, /var fills up and causes the VR to either stop passing traffic or perform necessary tasks in the VPC.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Change applied to opt/cloud/templates/conntrackd.conf.templ in systemvm.iso inside of cloud-scripts.tgz. systemvm.iso distributed to all Cloudstack KVM hosts and placed at /usr/share/cloudstack-common/vms/systemvm.iso. Redundant VPC restarted with cleanup. Confirmed change present and monitored /var/log/daemon.log for traffic entries while generating traffic via a private gateway using iperf.

@boring-cyborg

boring-cyborg Bot commented Sep 14, 2022

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@codecov

codecov Bot commented Sep 14, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #6738 (4454b2e) into 4.18 (d958882) will increase coverage by 0.00%.
Report is 3 commits behind head on 4.18.
The diff coverage is 75.00%.

@@            Coverage Diff            @@
##               4.18    #6738   +/-   ##
=========================================
  Coverage     13.02%   13.02%           
- Complexity     9029     9030    +1     
=========================================
  Files          2720     2720           
  Lines        256998   257001    +3     
  Branches      40081    40083    +2     
=========================================
+ Hits          33462    33463    +1     
- Misses       219335   219337    +2     
  Partials       4201     4201           
Files Changed Coverage Δ
...ervisor/kvm/resource/LibvirtComputingResource.java 18.31% <60.00%> (+0.01%) ⬆️
...om/cloud/hypervisor/kvm/resource/LibvirtVMDef.java 67.13% <100.00%> (ø)
...er/src/main/java/com/cloud/hypervisor/KVMGuru.java 50.81% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4190

@yadvr

yadvr commented Sep 14, 2022

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr

yadvr commented Oct 8, 2022

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@yadvr yadvr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory LGTM, we need to check if the log file is used at all by CloudStack

@yadvr yadvr added this to the 4.18.0.0 milestone Oct 8, 2022
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 4378

@yadvr

yadvr commented Oct 9, 2022

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4397

@yadvr

yadvr commented Oct 9, 2022

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a Jenkins job has been kicked to build packages. It will be bundled with SystemVM template(s). I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 4403

@yadvr

yadvr commented Oct 9, 2022

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✖️ el8 ✔️ debian ✔️ suse15. SL-JID 4404

@yadvr

yadvr commented Oct 9, 2022

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-5093)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 45525 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6738-t5093-kvm-centos7.zip
Smoke tests completed. 104 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

# ESTABLISHED CLOSED TIME_WAIT CLOSE_WAIT for TCP
# }
}
Stats {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shawniverson
should this be a separated section or under the "General" section ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shawniverson I want to merge this but can you explain the consequences of question first, please?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me double check this for everybody and ensure it is at the right level.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR cannot proceed. I did not place this block at the right level and when placed at the right level I am getting an error

conntrackd[6835]: [Thu Oct 13 12:46:05 2022] (pid=6835) [ERROR] cannot use both `Stats' and `Sync' clauses in conntrackd.conf

Apologies for the trouble. I will go back to the drawing board on this. Still a problem.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are no options in Sync to just disable logging there. I was trying to avoid turning off logging in the General block. It seems to be the only option.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need some advice from CloudStack developers on this. I can revise this PR or submit a new PR with logging off in in the General block instead, but I need feedback on whether any of the conntrackd logging is even being used before proceeding.

@ghost ghost Oct 13, 2022 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the man page for the General section:

[LogFile <on|off|filename>]
    Enable [conntrackd(8)] to log to a file.

    Example: LogFile on

    Default is off. The default logfile is /var/log/conntrackd.log.

[Syslog <on|off|facility>]
    Enable connection logging via Syslog. If you set the facility, use the same as in the Stats section, otherwise you'll get a warning message.

    Example: Syslog local0

    Default is off.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shawniverson there was talk of creating a central logging facility once. For that the syslog facility would be nice.
If you turn off logging I would say it should be done with a global setting. I am not sure if the logging of conntrackd is used functionally but I imagine that it is useful for people running redundant routers.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaanHoogland A global setting makes sense. I'll study this and see what I can do.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@shawniverson I'm marking this PR as draft for now

@DaanHoogland
DaanHoogland marked this pull request as draft October 14, 2022 07:25
@DaanHoogland

Copy link
Copy Markdown
Contributor

@shawniverson can you resolve the conflicts here, please?

@ghost

ghost commented Dec 13, 2022

Copy link
Copy Markdown
Author

@DaanHoogland I need guidance on the source code. I need to add a global setting for this to toggle the logging in conntrackd, but I am struggling to find where in the source this change would be made. Sorry, but I'm not terribly familiar with the source and it is quite vast.

@DaanHoogland
DaanHoogland changed the base branch from main to 4.18 June 22, 2023 12:46
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6313

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-6825)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43253 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6738-t6825-kvm-centos7.zip
Smoke tests completed. 106 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_migrate_VM_and_root_volume Error 79.71 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 52.37 test_vm_life_cycle.py
test_01_vpc_site2site_vpn_multiple_options Failure 405.91 test_vpc_vpn.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@shawniverson are you still interested in making this configurable?

@weizhouapache

Copy link
Copy Markdown
Member

ping @shawniverson

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6571

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6596

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-7198)

@weizhouapache weizhouapache modified the milestones: 4.18.1.0, 4.18.2.0 Aug 15, 2023
@yadvr

yadvr commented Aug 22, 2023

Copy link
Copy Markdown
Member

@shawniverson are we expecting any further changes, asking as PR is in draft
@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6849

@DaanHoogland

Copy link
Copy Markdown
Contributor

Are you still looking at this @shawniverson ?

@DaanHoogland

Copy link
Copy Markdown
Contributor

@shawniverson I am closing this, please reopen if you feel this still has potential.

@DaanHoogland DaanHoogland modified the milestones: 4.18.2.0, unplanned Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conntrackd filling up var

5 participants