Compression profile gzip level too high-f5-False

error
f5
best-practices
false
Compression profile gzip level too high-f5-False
0

#1

Compression profile gzip level too high-f5-False

Vendor: f5

OS: False

Description:
Setting a higher compression level makes compressed content smaller, but the cost of higher CPU usage and longer time to compress the content. The difference in terms of percentage gets lower the higher the level and setting this too high is not recommended. indeni will alert if the gzip compression level is too high.

Remediation Steps:
Set the compression level to a value RuleEquals, or below 6 for the reported profiles\nhttps://support.f5.com/csp/article/K3393

How does this work?
This alert uses the iControl REST interface to extract compression levels set for each of the configured HTTP Compression Profiles.

Why is this important?
Setting a higher compression level makes compressed content smaller, but the cost of higher CPU usage and longer time to compress the content. The difference in terms of percentage gets lower the higher the level and setting this too high is not recommended. This metric would alert for any levels above 6.

Without Indeni how would you find this?
Login to the device’s web interface and click on “Local Traffic” -> “Profiles” -> “HTTP Compression”. This would show a list of the available compression profiles. For each profile in the list, check the option “gzip Compression Level”. In case the configuration is divided in multiple partitions changing to the “All [Read-only]” partition is recommended.

f5-rest-mgmt-tm-ltm-profile-http-compression

 #! META
name: f5-rest-mgmt-tm-ltm-profile-http-compression
description: Determine compression level of compression profiles
type: monitoring
monitoring_interval: 60 minutes
requires:
    vendor: "f5"
    product: "load-balancer"
    rest-api: "true"

#! COMMENTS
f5-high-compression-profile-high-gzip-level:
    why: |
        Setting a higher compression level makes compressed content smaller, but the cost of higher CPU usage and longer time to compress the content. The difference in terms of percentage gets lower the higher the level and setting this too high is not recommended. This metric would alert for any levels above 6.
    how: |
        This alert uses the iControl REST interface to extract compression levels set for each of the configured HTTP Compression Profiles.
    without-indeni: |
        Login to the device's web interface and click on "Local Traffic" -> "Profiles" -> "HTTP Compression". This would show a list of the available compression profiles. For each profile in the list, check the option "gzip Compression Level". In case the configuration is divided in multiple partitions changing to the "All [Read-only]" partition is recommended.
    can-with-snmp: true
    can-with-syslog: false

#! REMOTE::HTTP
url: /mgmt/tm/ltm/profile/http-compression?$select=fullPath,gzipLevel,contentTypeInclude
protocol: HTTPS

#! PARSER::JSON

_metrics:
    - # Record compression profiles with compression level lower or equal to 6
        _groups:
            "$.items[0:]":
                _tags:
                    "im.name":
                        _constant: "f5-high-compression-profile-high-gzip-level"
                    "name":
                        _value: "fullPath"
                    "im.dstype.displaytype":
                        _constant: "boolean"
                _value.complex:
                    value:
                        _value: "gzipLevel"

f5_high_compression_profile

package com.indeni.server.rules.library.templatebased.f5

import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.ThresholdDirection
import com.indeni.server.rules.library.templates.NumericThresholdOnComplexMetricWithItemsTemplateRule

/**
  *
  */
case class f5_high_compression_profile() extends NumericThresholdOnComplexMetricWithItemsTemplateRule(
  ruleName = "f5_high_compression_profile",
  ruleFriendlyName = "F5 Devices: Compression profile gzip level too high",
  ruleDescription = "Setting a higher compression level makes compressed content smaller, but the cost of higher CPU usage and longer time to compress the content. The difference in terms of percentage gets lower the higher the level and setting this too high is not recommended. indeni will alert if the gzip compression level is too high.",
  metricName = "f5-high-compression-profile-high-gzip-level",
  threshold = 6.0,
  thresholdDirection = ThresholdDirection.ABOVE,
  applicableMetricTag = "name",
  alertItemsHeader = "Affected Profiles",
  alertDescription = "Setting a higher compression level makes compressed content smaller, but the cost of higher CPU usage and longer time to compress the content. The difference in terms of percentage gets lower the higher the level and setting this too high is not recommended. In general the increments after level 4 comes in the ranges of 0.15-0.25%. Of course this depends on the content being served.\n\nThis alert was added per the request of <a target=\"_blank\" href=\"https://se.linkedin.com/in/patrik-jonsson-6527932\">Patrik Jonsson</a>.",
  alertItemDescriptionFormat = "The compression level used is %.0f",
  baseRemediationText = "Set the compression level to a value RuleEquals, or below 6 for the reported profiles\nhttps://support.f5.com/csp/article/K3393")()