Hi Thomas, This very likely answers why you are not seeing all you expect in the database. Reason you get duplicates is pmacct is trying to insert into the database more than once per 600 seconds (as per your configuration) and sql_dont_try_update is set to true.
So quickest work-around is to set sql_dont_try_update to false; but i guess it's good to spend some efforts to understand why pmacct is behaving like that. The cause "safe action" gives a pointer and it's due to one of the two following reasons: * There are too many 'src_host, dst_host' aggregates for the configured sql_cache_entries value. This should be excluded as only 500-600 entries are to be inserted while the config would allow for sql_cache_entries entries (256K). But, it could be it stops on the first of a series of INSERTs, so there is more data to dump. Knowing your environment, you can ultimately comment whether the 256K value is good or not. * The system is short of memory (or the OS limits the amount of memory the pmacct process(es) can allocate); so at some stage pmacct asks for a new chunk of memory to insert a new entry in the SQL cache and it's not able to get it; this results in pmacct purging the cache content in an effort to make room to new data. Please check whether this can be the case. Let me know. Cheers, Paolo On Sat, Sep 11, 2010 at 05:49:17PM +0000, Thomas Raabo - ZitCom A/S wrote: > Once every 10 min iam getting some errors > > DEBUG ( default/mysql ): purging process (CAUSE: safe action) > ( default/mysql ) *** Purging cache - START *** > DEBUG ( default/mysql ): 568 VALUES statements sent to the MySQL server. > ERROR ( default/mysql ): Duplicate entry > '0-unknown-0:0:0:0:0:0-0:0:0:0:0:0-0-0-0-188.176.68.71-194.182.12' for key > 'PRIMARY' > > DEBUG ( default/mysql ): purging process (CAUSE: safe action) > ( default/mysql ) *** Purging cache - START *** > DEBUG ( default/mysql ): 569 VALUES statements sent to the MySQL server. > ERROR ( default/mysql ): Duplicate entry > '0-unknown-0:0:0:0:0:0-0:0:0:0:0:0-0-0-0-91.100.100.103-94.231.97' for key > 'PRIMARY' > > DEBUG ( default/mysql ): purging process (CAUSE: safe action) > ( default/mysql ) *** Purging cache - START *** > DEBUG ( default/mysql ): 565 VALUES statements sent to the MySQL server. > ERROR ( default/mysql ): Duplicate entry > '0-unknown-0:0:0:0:0:0-0:0:0:0:0:0-0-0-0-94.231.102.73-95.166.47.' for key > 'PRIMARY' > > My config > > ! nfacctd configuration example > ! > ! Did you know CONFIG-KEYS contains the detailed list of all configuration > keys > ! supported by 'nfacctd' and 'pmacctd' ? > ! > debug: true > !daemonize: true > > aggregate: tag, src_host, dst_host > plugin_pipe_size: 40960000 > plugin_buffer_size: 40960 > nfacctd_port: 9000 > > ! nfacctd_time_secs: true > > nfacctd_time_new: true > > plugins: mysql > > sql_db: pmacct > sql_table: acct > sql_table_version: 2 > sql_passwd: ***** > sql_user: root > sql_refresh_time: 600 > sql_multi_values: 100000 > sql_dont_try_update: true > sql_cache_entries: 256000 > ! sql_optimize_clauses: true > sql_history: 10m > sql_history_roundoff: mh > > Thomas > _______________________________________________ > pmacct-discussion mailing list > http://www.pmacct.net/#mailinglists _______________________________________________ pmacct-discussion mailing list http://www.pmacct.net/#mailinglists