[ZBX-15442] Zabbix proxy ignores DataSenderFrequency Created: 2019 Jan 11 Updated: 2019 Feb 12 Resolved: 2019 Feb 08 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P) |
Affects Version/s: | None |
Fix Version/s: | 4.0.5rc1, 4.2.0beta1, 4.2 (plan) |
Type: | Problem report | Priority: | Minor |
Reporter: | Ivan Labáth | Assignee: | Andrejs Sitals |
Resolution: | Fixed | Votes: | 0 |
Labels: | Datasender | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
linux |
Issue Links: |
|
||||||||
Team: | Team C | ||||||||
Sprint: | Sprint 48, Jan 2019, Sprint 49 (Feb 2019) | ||||||||
Story Points: | 0.125 |
Description |
Steps to reproduce:
Result: Proxy sends data roughly every second - sleeps exactly 1s between seding, often sending exactly 0 items, generating unnecessary traffic. Expected: Proxy sleeps 10s. Description Issue affects zabbix-proxy 3.4.12. I haven't verified newer versions of proxy, but source on svn://svn.zabbix.com/trunk/src/zabbix_proxy/datasender/datasender.c seems affected. In ZBX_THREAD_ENTRY(datasender_thread), it updates proctitle as ".. idle $CONFIG_PROXYDATA_FREQUENCY sec", but sleeps only for ZBX_TASK_UPDATE_FREQUENCY (constant 1), and then goes on again to "sending data". It seems to me, it should sleep CONFIG_PROXYDATA_FREQUENCY. I have searched for relevant bug reports and only found 2 semi-relevant. One a seemingly misguided request that was rejected. Change in the second one might have introduced the bug. |
Comments |
Comment by Glebs Ivanovskis [ 2019 Jan 11 ] |
Probably related to |
Comment by Andrejs Sitals [ 2019 Jan 28 ] |
Looks like process title is misleading. Either zbx_setproctitle() should use ZBX_TASK_UPDATE_FREQUENCY to specify idle time, or it should be extended to include both ZBX_TASK_UPDATE_FREQUENCY and CONFIG_PROYXDATA_FREQUENCY. As for generating unnecessary traffic which was mentioned in issue's description - proxy not only sends data to the server, but also executes some tasks. Examples of such tasks include "check now" tasks and executing scripts on proxy or on agent via proxy (both scripts from frontend AND scripts that are configured in actions). ZBX_TASK_UPDATE_FREQUENCY controls how often proxy checks if there are tasks to be executed. Currently it's hard-coded (1 second) and cannot be configured in config file. |
Comment by Vladislavs Sokurenko [ 2019 Jan 28 ] |
(1) [D] Should change documentation so that it explains connections that occur every second regardless of DataSenderFrequency Should be changed to: andris Reviewed, seems ok. vso CLOSED |
Comment by Ivan Labáth [ 2019 Jan 30 ] |
To clarify problem: Expected: Processing scheduled tasks every second seems reasonable, but zabbix_sender AFAICT doesn't connect to agents (nor should it) so task to be executed on agent are irrelevant. As for executing scripts and scheduled tasks, are they actually executed in zabbix_sender (as opposed to say task_manager)? Does it mean adding a "sleep 10" task would make zabbix_sender only send data every 10s? In the sources I see zabbix_sender collecting and transforming task data, but I haven't found any execution, in which case it seems reasonable to me, to gather and send that data every CONFIG_PROXYDATA_FREQUENCY, like all other data. As for specifics in code, I see zabbix_sender loop only collects host availability, history, discovery and auto registration data (as mentioned in function header) every CONFIG_PROXYDATA_FREQUENCY, but it separately also gathers tasks every second (ZBX_TASK_UPDATE_FREQUENCY) and adds ZBX_DATASENDER_TASKS_REQUEST to flags unconditionally, and then goes on to send/receive .. nothing. |
Comment by Ivan Labáth [ 2019 Jan 30 ] |
If CONFIG_PROXYDATA_FREQUENCY is not supposed to affect TASKs (not sure why), how about another parameter that would disable or reduce task polling frequency. We don't use tasks and even if we did, waiting a minute for results would not be an issue, but with many proxies and using tls, a connection every second can be quite relevant. |
Comment by Andris Mednis [ 2019 Feb 01 ] |
Created ZBXNEXT-4998 . |
Comment by Andrejs Sitals [ 2019 Feb 05 ] |
Available in versions:
|