Optimizing Scalyr agent settings to reduce skipped bytes
The Scalyr Agent's default settings are somewhat conservative to prevent the consumption of excessive server resources. This also helps avoid situations where a configuration bug leads to massive amounts of logs being generated, unexpectedly driving up your Scalyr costs. The trade-off is that logs which are prone to significant bursts of data can overwhelm the Scalyr Agent and cause it to skip logs. If you are seeing skipped logs messages in your agent.log, you may wish to consider implementing these settings.
The easiest way to check if the agent is skipping logs is to search for
"skipForTooFarBehind" && $logfile=="/var/log/scalyr-agent-2/agent.log". If there are no results, then no bytes have been skipped. Otherwise, each log line in the results will show which logs had skipped bytes, and how many bytes were skipped in each log.
The following settings should allow a single agent to achieve around 5MB/s of raw log throughput. A future version of the agent will incorporate these settings by default.
If you are still seeing skipped bytes after implementing these settings and wish to capture that data in Scalyr, please contact firstname.lastname@example.org to help you further optimize your agent settings.
The following pages provide settings in two different formats: agent.json and Kubernetes config map.
For more information on agent configuration see the following:
- Configuring the Scalyr linux agent via agent.json
- Configuring the Scalyr Kubernetes agent with ConfigMap
- Environment-aware variables in a ConfigMap
- Default scalyr-agent-2 ConfigMap
agent.json settings (paste beneath API key declaration in agent.json configuration file):
YAML ConfigMap settings: