|
| 1 | +--- |
| 2 | +title: Reducir la huella de CPU del agente de infraestructura |
| 3 | +type: troubleshooting |
| 4 | +tags: |
| 5 | + - Infrastructure |
| 6 | + - Infrastructure monitoring troubleshooting |
| 7 | + - Troubleshoot infrastructure |
| 8 | +metaDescription: Troubleshooting suggestions if the New Relic infrastructure agent is consuming too much CPU. |
| 9 | +freshnessValidatedDate: never |
| 10 | +translationType: machine |
| 11 | +--- |
| 12 | + |
| 13 | +## Problema |
| 14 | + |
| 15 | +El agente New Relic Infrastructure está consumiendo demasiada CPU. |
| 16 | + |
| 17 | +## Solución |
| 18 | + |
| 19 | +El agente New Relic Infrastructure está diseñado para informar una amplia gama de datos del sistema con un consumo mínimo de CPU y memoria. Sin embargo, si necesita reducir el consumo de CPU, puede deshabilitar o disminuir la frecuencia de muestreo de varios muestreadores y complementos. |
| 20 | + |
| 21 | +Este tema destaca algunas `newrelic-infra.yml` configuraciones que pueden reducir el uso de CPU: |
| 22 | + |
| 23 | +* [Reducir el muestreo de eventos](#samplers) |
| 24 | +* [Reducir los informes del complemento del agente](#reduce_plugins) |
| 25 | +* [Revisar integración en el host](#on_host_integrations) |
| 26 | + |
| 27 | +### Reducir el muestreo de eventos [#samplers] |
| 28 | + |
| 29 | +El agente de infraestructura reporta varios [eventos de incumplimiento](/docs/infrastructure/manage-your-data/data-instrumentation/default-infrastructure-events) en frecuencias específicas. Para reducir la sobrecarga, puede reducir la frecuencia de muestreo en segundos o puede desactivar completamente los muestreadores estableciendo el valor de propiedad correspondiente en `-1`. |
| 30 | + |
| 31 | +<Callout variant="important"> |
| 32 | + No recomendamos una frecuencia de muestreo superior a 60 segundos porque es posible que vea espacios en los gráficos de la interfaz de usuario de New Relic. |
| 33 | +</Callout> |
| 34 | + |
| 35 | +La siguiente tabla enumera algunos muestreadores para configurar: |
| 36 | + |
| 37 | +<table> |
| 38 | + <thead> |
| 39 | + <tr> |
| 40 | + <th> |
| 41 | + evento |
| 42 | + </th> |
| 43 | + |
| 44 | + <th> |
| 45 | + Frecuencia de muestreo |
| 46 | + </th> |
| 47 | + |
| 48 | + <th> |
| 49 | + Lista de permitir/denegar |
| 50 | + </th> |
| 51 | + </tr> |
| 52 | + </thead> |
| 53 | + |
| 54 | + <tbody> |
| 55 | + <tr> |
| 56 | + <td> |
| 57 | + Red |
| 58 | + </td> |
| 59 | + |
| 60 | + <td> |
| 61 | + [Tasa de muestreo de red](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#metrics-network-sample-rate) |
| 62 | + </td> |
| 63 | + |
| 64 | + <td> |
| 65 | + No disponible |
| 66 | + </td> |
| 67 | + </tr> |
| 68 | + |
| 69 | + <tr> |
| 70 | + <td> |
| 71 | + Proceso |
| 72 | + </td> |
| 73 | + |
| 74 | + <td> |
| 75 | + [Tasa de muestreo del proceso](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#metrics-process-sample-rate) |
| 76 | + </td> |
| 77 | + |
| 78 | + <td> |
| 79 | + [Lista de permitidos (solo Windows)](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#allowed-list-process-sample) |
| 80 | + </td> |
| 81 | + </tr> |
| 82 | + |
| 83 | + <tr> |
| 84 | + <td> |
| 85 | + Almacenamiento |
| 86 | + </td> |
| 87 | + |
| 88 | + <td> |
| 89 | + [Tasa de muestreo de almacenamiento](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#metrics-storage-sample-rate) |
| 90 | + </td> |
| 91 | + |
| 92 | + <td> |
| 93 | + [Lista de denegación](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#file-devices-ignored) |
| 94 | + </td> |
| 95 | + </tr> |
| 96 | + |
| 97 | + <tr> |
| 98 | + <td> |
| 99 | + Sistema |
| 100 | + </td> |
| 101 | + |
| 102 | + <td> |
| 103 | + [Frecuencia de muestreo del sistema](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#metrics-system-sample-rate) |
| 104 | + </td> |
| 105 | + |
| 106 | + <td> |
| 107 | + No disponible |
| 108 | + </td> |
| 109 | + </tr> |
| 110 | + </tbody> |
| 111 | +</table> |
| 112 | + |
| 113 | +### Reducir los informes del complemento del agente [#reduce\_plugins][#reduce_plugins] |
| 114 | + |
| 115 | +El agente de infraestructura tiene un complemento incorporado que recopila datos de inventario (configuración específica del sistema e información de estado). Para algunos sistemas, el consumo de CPU puede ser relativamente alto si el complemento recopila muchos datos. Para reducir el espacio, puede deshabilitar o disminuir la frecuencia de muestreo para complementos específicos que informan datos que no desea. |
| 116 | + |
| 117 | +<CollapserGroup> |
| 118 | + <Collapser id="enable_disable" title="Cómo habilitar y deshabilitar el complemento"> |
| 119 | + * <DNT>**Disable a single plugin:**</DNT> Para deshabilitar un complemento, establezca el valor de propiedad correspondiente en `-1`. |
| 120 | + |
| 121 | + * <DNT>**Disable all plugins:**</DNT> `disable_all_plugins: true` |
| 122 | + |
| 123 | + * <DNT>**Enable selected plugins:**</DNT> Para habilitar determinado complemento, inserte una excepción en `disable_all_plugins`. Por ejemplo, la siguiente configuración desactiva todos los complementos y vuelve a habilitar las interfaces de red y el complemento SELinus para informar cada 120 segundos: |
| 124 | + |
| 125 | + ```yml |
| 126 | + disable_all_plugins: true |
| 127 | + network_interface_interval_sec: 120 |
| 128 | + selinux_interval_sec: 120 |
| 129 | + ``` |
| 130 | + </Collapser> |
| 131 | +
|
| 132 | + <Collapser |
| 133 | + id="selinux" |
| 134 | + title={<>Deshabilitar SELinux <InlineCode> |
| 135 | + semodule -l |
| 136 | + </InlineCode> (solo Linux)</> |
| 137 | + } |
| 138 | + > |
| 139 | + El complemento SELinux invoca periódicamente el comando del sistema `semodule -l` para obtener información sobre los módulos SELinux existentes. En la mayoría de las distribuciones CentOS/RedHat, este comando generará picos de consumo de CPU. |
| 140 | + |
| 141 | + Para deshabilitar esta funcionalidad, inserte la siguiente opción de configuración en su archivo `/etc/newrelic-infra.yml` : |
| 142 | + |
| 143 | + `selinux_enable_semodule: false` |
| 144 | + </Collapser> |
| 145 | + |
| 146 | + <Collapser id="sysctl" title="Reducir o deshabilitar Sysctl (solo Linux)"> |
| 147 | + El complemento Sysctl recorre toda la estructura del directorio `/sys` y lee los valores de todos los archivos allí. Deshabilitarlo o reducir el intervalo puede disminuir parte del tiempo del sistema de CPU en el agente de infraestructura. |
| 148 | + |
| 149 | + Puede deshabilitar la frecuencia del inventario configurándola en un número negativo o reducir la frecuencia estableciendo el valor de configuración `sysctl_interval_sec` en la cantidad de segundos entre ejecuciones consecutivas del complemento. |
| 150 | + |
| 151 | + Por ejemplo, para ejecutar el complemento una vez cada 10 minutos: |
| 152 | + |
| 153 | + ```yml |
| 154 | + sysctl_interval_sec: 600 |
| 155 | + ``` |
| 156 | + |
| 157 | + Para desactivar el complemento Sysctl: |
| 158 | + |
| 159 | + ```yml |
| 160 | + sysctl_interval_sec: -1 |
| 161 | + ``` |
| 162 | + |
| 163 | + El valor predeterminado actual para la propiedad `sysctl_interval_sec` es `60`. |
| 164 | + </Collapser> |
| 165 | + |
| 166 | + <Collapser id="additional_plugins" title="Complemento adicional para reducir o deshabilitar"> |
| 167 | + Los siguientes complementos de inventario no consumen especialmente CPU, pero aún puedes reducir su frecuencia o deshabilitarlos configurando las opciones de configuración correspondientes. |
| 168 | + |
| 169 | + <DNT> |
| 170 | + **Linux plugins** |
| 171 | + </DNT> |
| 172 | + |
| 173 | + Para conocer la configuración de estos complementos de Linux, consulte [las variables del complemento](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#plugins-variables): |
| 174 | + |
| 175 | + * Grupos de seguridad en la nube |
| 176 | + |
| 177 | + * Daemon Tools |
| 178 | + |
| 179 | + * DPKG |
| 180 | + |
| 181 | + * Facter |
| 182 | + |
| 183 | + * Módulos del núcleo |
| 184 | + |
| 185 | + * Interfaces de red |
| 186 | + |
| 187 | + * RPM |
| 188 | + |
| 189 | + * SELinux |
| 190 | + |
| 191 | + * Supervisord |
| 192 | + |
| 193 | + * Sysctl |
| 194 | + |
| 195 | + * Systemd |
| 196 | + |
| 197 | + * SysV |
| 198 | + |
| 199 | + * Advenedizo |
| 200 | + |
| 201 | + * Usuario |
| 202 | + |
| 203 | + * Configuración SSHD |
| 204 | + |
| 205 | + <DNT> |
| 206 | + **Windows plugins** |
| 207 | + </DNT> |
| 208 | + |
| 209 | + Para conocer la configuración de estos complementos de Windows, consulte [las variables del complemento](/docs/infrastructure/install-configure-manage-infrastructure/configuration/infrastructure-configuration-settings#plugins-variables): |
| 210 | + |
| 211 | + * Interfaces de red |
| 212 | + |
| 213 | + * Servicios de windows |
| 214 | + |
| 215 | + * Actualizaciones de Windows |
| 216 | + </Collapser> |
| 217 | +</CollapserGroup> |
| 218 | + |
| 219 | +### Revisar integración en el host [#on\_host\_integrations][#on_host_integrations] |
| 220 | + |
| 221 | +Si utiliza infraestructura integración en el host, esto puede tener impactos adicionales en el uso de la CPU. La naturaleza del impacto y los métodos para ajustarlo dependen de la integración que esté utilizando. |
| 222 | + |
| 223 | +A continuación se muestran algunas formas de ajustar el uso de CPU de integración en el host: |
| 224 | + |
| 225 | +* Vea si su [integración](/docs/integrations/host-integrations/host-integrations-list) tiene opciones de configuración que pueda ajustar. |
| 226 | +* Si es posible, distribuya la carga de monitoreo agregando un agente de infraestructura adicional. Por ejemplo, la integración de Kafka permite un [despliegue multiagente](/docs/integrations/host-integrations/host-integrations-list/kafka-monitoring-integration#multiple-agents). |
0 commit comments