Data Cleaning: Difference between revisions
(Add troubleshooting section for disk full scenarios with du command and increasing maxpoolsize) |
(Improved structure: added architecture diagram, fixed section numbering, improved syntax highlighting, streamlined AI RAG section) |
||
| Line 1: | Line 1: | ||
This guide explains how VoIPmonitor manages data retention for both captured packets (PCAP files) and Call Detail Records (CDRs) in the database. Proper configuration is essential for managing disk space and maintaining long-term database performance. | |||
== Overview == | |||
VoIPmonitor generates two primary types of data that require periodic cleaning: | VoIPmonitor generates two primary types of data that require periodic cleaning: | ||
*'''PCAP Files:''' Raw packet captures of SIP/RTP/GRAPH data stored on the filesystem in the spool directory. These can consume significant disk space. | * '''PCAP Files:''' Raw packet captures of SIP/RTP/GRAPH data stored on the filesystem in the spool directory. These can consume significant disk space. | ||
*'''CDR Data:''' Call metadata stored in the MySQL database. Large tables can slow down GUI performance if not managed properly. | * '''CDR Data:''' Call metadata stored in the MySQL database. Large tables can slow down GUI performance if not managed properly. | ||
The system uses two separate, independent mechanisms to manage the retention of this data | The system uses two separate, independent mechanisms to manage the retention of this data: | ||
<kroki lang="plantuml"> | |||
@startuml | |||
skinparam shadowing false | |||
skinparam defaultFontName Arial | |||
skinparam rectangle { | |||
BorderColor #4A90E2 | |||
BackgroundColor #FFFFFF | |||
} | |||
rectangle "VoIPmonitor Sensor" as sensor | |||
package "Filesystem Storage" { | |||
folder "/var/spool/voipmonitor" as spool { | |||
file "SIP PCAPs" as sip | |||
file "RTP PCAPs" as rtp | |||
file "GRAPH files" as graph | |||
file "AUDIO files" as audio | |||
} | |||
} | |||
database "MySQL Database" { | |||
collections "cdr" as cdr | |||
collections "cdr_next" as cdrnext | |||
collections "register_state" as reg | |||
collections "sip_msg" as sipmsg | |||
} | |||
sensor --> spool : writes | |||
sensor --> cdr : writes | |||
rectangle "Filesystem Cleaner\n(maxpoolsize/maxpooldays)" as fscleaner #E8F5E9 | |||
rectangle "Database Cleaner\n(cleandatabase)" as dbcleaner #E3F2FD | |||
fscleaner --> spool : deletes old files | |||
dbcleaner --> cdr : drops partitions | |||
note bottom of fscleaner : Runs every 5 minutes\nDeletes oldest data first | |||
note bottom of dbcleaner : Daily partition drop\nInstant operation | |||
@enduml | |||
</kroki> | |||
== Filesystem Cleaning (PCAP Spool Directory) == | |||
The sensor stores captured call data in a structured directory tree on the local filesystem. | The sensor stores captured call data in a structured directory tree on the local filesystem. | ||
=== Spool Directory Location === | === Spool Directory Location === | ||
By default, all data is stored in | |||
By default, all data is stored in <code>/var/spool/voipmonitor</code>. This location can be changed by setting the <code>spooldir</code> option in <code>voipmonitor.conf</code>. | |||
=== Retention Configuration === | === Retention Configuration === | ||
The | The cleaning process runs automatically every 5 minutes and removes the oldest data based on the rules you define in <code>voipmonitor.conf</code>. You can set limits based on total size (in Megabytes) or age (in days). If both a size and day limit are set for the same data type, the first limit that is reached will trigger the cleaning. | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Parameter !! Default Value !! Description | ! Parameter !! Default Value !! Description | ||
|- | |- | ||
| | | <code>maxpoolsize</code> || 102400 (100 GB) || The total maximum disk space for '''all''' captured data (SIP, RTP, GRAPH, AUDIO). | ||
|- | |- | ||
| | | <code>maxpooldays</code> || (unset) || The maximum number of days to keep '''all''' captured data. | ||
|- | |- | ||
| | | <code>maxpoolsipsize</code> || (unset) || A specific size limit for SIP PCAP files only. | ||
|- | |- | ||
| | | <code>maxpoolsipdays</code> || (unset) || A specific age limit for SIP PCAP files only. | ||
|- | |- | ||
| | | <code>maxpoolrtpsize</code> || (unset) || A specific size limit for RTP PCAP files only. | ||
|- | |- | ||
| | | <code>maxpoolrtpdays</code> || (unset) || A specific age limit for RTP PCAP files only. | ||
|- | |- | ||
| | | <code>maxpoolgraphsize</code> || (unset) || A specific size limit for GRAPH files only. | ||
|- | |- | ||
| | | <code>maxpoolgraphdays</code> || (unset) || A specific age limit for GRAPH files only. | ||
|- | |- | ||
| | | <code>maxpoolaudiosize</code> || (unset) || A specific size limit for converted audio files (WAV/OGG) only. | ||
|- | |- | ||
| | | <code>maxpoolaudiodays</code> || (unset) || An age limit for converted audio files (WAV/OGG) only. | ||
|} | |} | ||
=== | === Troubleshooting: Disk Full / Files Disappearing === | ||
If you see errors when attempting to extract older calls from the GUI, or if call files are disappearing too quickly, your spool directory may have reached its size limit. | |||
If you see errors when attempting to extract older calls from the GUI, or if call files are disappearing too quickly, your spool directory may have reached its size limit | |||
=== Diagnosis: Check Disk Usage === | ==== Diagnosis: Check Disk Usage ==== | ||
# Identify the sensor/probe responsible for the missing data. | |||
# SSH into the sensor/probe and navigate to the spooldir. | |||
# Check the disk usage: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cd /var/spool/voipmonitor | cd /var/spool/voipmonitor | ||
du -h --max-depth=1 ./ | du -h --max-depth=1 ./ | ||
# | # Example output: | ||
# 150G ./2025-01 | # 150G ./2025-01 | ||
# 120G ./2024-12 | # 120G ./2024-12 | ||
| Line 75: | Line 107: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
# Compare with the configured limit: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
grep maxpoolsize /etc/voipmonitor.conf | grep maxpoolsize /etc/voipmonitor.conf | ||
# Example output: maxpoolsize = 102400 (100 GB in MB) | # Example output: maxpoolsize = 102400 (100 GB in MB) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Resolution: Increase Spooldir Size === | ==== Resolution: Increase Spooldir Size ==== | ||
If the actual usage | If the actual usage exceeds the configured limit, increase <code>maxpoolsize</code>: | ||
<syntaxhighlight lang="ini"> | <syntaxhighlight lang="ini"> | ||
# Edit /etc/voipmonitor.conf | # Edit /etc/voipmonitor.conf | ||
[general] | [general] | ||
maxpoolsize = 716800 # 700 GB in MB | |||
maxpoolsize = 716800 | maxpooldays = 90 # Optional: Keep data for last 90 days | ||
</syntaxhighlight> | |||
Apply changes: | |||
<syntaxhighlight lang="bash"> | |||
systemctl restart voipmonitor | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Maintenance: Re-indexing the Spool Directory === | |||
VoIPmonitor maintains an index of all created PCAP files to perform cleaning efficiently without scanning the entire directory tree. If this index becomes corrupt, or if you manually move files into the spool, old data may not be deleted correctly. | |||
To trigger a manual re-index via the manager API: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# | # Open a manager API session | ||
echo 'manager_file start /tmp/vmsck' | nc 127.0.0.1 5029 | |||
# | # Send the re-index command | ||
echo reindexfiles | nc -U /tmp/vmsck | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== | Note: This command requires <code>netcat</code> with support for UNIX sockets (<code>-U</code>). For alternative methods, see the [[Encryption_in_manager_api_customer|Manager API documentation]]. | ||
Managing the size of the | |||
== Database Cleaning (CDR Retention) == | |||
Managing the size of the <code>cdr</code> table and other large tables is critical for GUI performance. | |||
=== Partitioning Method (Recommended) === | |||
Since version 7, VoIPmonitor utilizes '''database partitioning''', which splits large tables into smaller, daily segments. This is the recommended method for managing database retention. | |||
== | {| class="wikitable" style="width:100%;" | ||
|- | |||
! Aspect !! Description | |||
|- | |||
| '''How it works''' || Set <code>cleandatabase = 30</code> in <code>voipmonitor.conf</code> to keep the last 30 days of data. | |||
|- | |||
| '''Why it's better''' || Dropping old partitions is instantaneous (milliseconds), regardless of row count. Zero database load. | |||
|- | |||
| '''Requirement''' || Partitioning is enabled by default on new installations. | |||
|} | |||
==== Quick Start: Global Retention ==== | ==== Quick Start: Global Retention ==== | ||
<syntaxhighlight lang=" | For most deployments, configure one parameter in <code>/etc/voipmonitor.conf</code>: | ||
# Keep all records for 30 days | |||
<syntaxhighlight lang="ini"> | |||
# Keep all records for 30 days | |||
cleandatabase = 30 | cleandatabase = 30 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The | The <code>cleandatabase</code> parameter acts as a global default for all <code>cleandatabase_*</code> options and applies to: | ||
* | * <code>cdr</code> - Call Detail Records | ||
* | * <code>message</code> - SIP MESSAGE texts | ||
* | * <code>sip_msg</code> - SIP OPTIONS/SUBSCRIBE/NOTIFY messages | ||
* | * <code>register_state</code> - SIP registration states | ||
* | * <code>register_failed</code> - Failed registration attempts | ||
==== | ==== Retention Parameters ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Parameter !! Default | ! Parameter !! Default !! Description | ||
|- | |- | ||
| | | <code>cleandatabase</code> || 0 (disabled) || Master retention setting in days. | ||
|- | |- | ||
| | | <code>cleandatabase_cdr</code> || 0 || Specific retention for <code>cdr</code> and <code>message</code> tables. | ||
|- | |- | ||
| | | <code>cleandatabase_rtp_stat</code> || 2 || Retention for detailed RTP statistics. | ||
|- | |- | ||
| | | <code>cleandatabase_sip_msg</code> || 0 || Retention for OPTIONS/SUBSCRIBE/NOTIFY. | ||
|- | |- | ||
| | | <code>cleandatabase_size</code> || (unset) || Alternative: size-based limit in MB (requires version 2024.05.1+). | ||
|- | |- | ||
| | | <code>partition_operations_enable_fromto</code> || 1-5 || Time window for partition operations (e.g., 1-5 AM). | ||
|} | |} | ||
More details: [[Sniffer_configuration#Database_Cleaning|Sniffer Configuration - Database Cleaning]]. | |||
== | === Legacy Method: Manual Deletion (Not Recommended) === | ||
For very old, non-partitioned databases, you would need custom scripts with <code>DELETE FROM cdr WHERE calldate < ...</code> queries. | |||
'''Warning:''' Manual DELETE on large tables is extremely slow and resource-intensive. A single operation on millions of rows can take hours and impact GUI performance. | |||
== Troubleshooting Disk Space Issues == | |||
=== Disk Space Not Reclaimed After Cleanup === | === Disk Space Not Reclaimed After Cleanup === | ||
If | If automatic cleanup runs but disk space is not freed from the MySQL data directory, check the <code>innodb_file_per_table</code> setting: | ||
<syntaxhighlight lang="sql"> | |||
<syntaxhighlight lang=" | SHOW GLOBAL VARIABLES LIKE 'innodb_file_per_table'; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{| class="wikitable" | |||
|- | |||
! Value !! Behavior | |||
|- | |||
| '''ON''' || Each table/partition has its own <code>.ibd</code> file. Dropping partitions reclaims space immediately. | |||
|- | |||
| '''OFF''' || All data in shared <code>ibdata1</code> file. Dropping partitions does '''not''' reduce file size. | |||
|} | |||
==== Solutions ==== | |||
;Option 1: Enable for Future Tables | |||
Add to | Add to <code>/etc/my.cnf</code> or <code>/etc/mysql/my.cnf</code>: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="ini"> | ||
[mysqld] | [mysqld] | ||
innodb_file_per_table = 1 | innodb_file_per_table = 1 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
systemctl restart mysql | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Note: This only affects NEW tables/partitions. Existing data in <code>ibdata1</code> remains. | |||
;Option 2: Reclaim Space from Existing Tables | |||
<syntaxhighlight lang="sql"> | |||
<syntaxhighlight lang=" | |||
OPTIMIZE TABLE cdr; | OPTIMIZE TABLE cdr; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Warning:''' | '''Warning:''' Requires significant free disk space to duplicate table data. May crash if disk is nearly full. | ||
;Option 3: Export and Re-import | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mysqldump -u root -p voipmonitor > voipmonitor_backup.sql | mysqldump -u root -p voipmonitor > voipmonitor_backup.sql | ||
| Line 208: | Line 254: | ||
=== Monitoring Database Health === | === Monitoring Database Health === | ||
==== SQL Queue Metrics ==== | |||
The sensor tracks queue metrics visible in GUI → Settings → Sensors → Status: | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 222: | Line 262: | ||
! Metric !! Description !! Healthy Range | ! Metric !! Description !! Healthy Range | ||
|- | |- | ||
| SQLq || | | '''SQLq''' || CDRs waiting to be written to database || Near 0, sporadic spikes OK | ||
|- | |- | ||
| SQLf || | | '''SQLf''' || Failed database write attempts || Zero (not growing) | ||
|} | |} | ||
* Consistently high/growing SQLq → database cannot keep up | |||
* Non-zero/growing SQLf → database errors or connectivity issues | |||
* Consistently high | |||
* Non-zero | |||
See [[SQL_queue_is_growing_in_a_peaktime|SQL Queue Troubleshooting]] for details. | |||
==== System Monitoring ==== | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Check system load | |||
cat /proc/loadavg | cat /proc/loadavg | ||
# Monitor disk I/O (shows only active processes) | |||
iotop -o | iotop -o | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | High I/O from <code>mysqld</code> processes may indicate slow storage or poorly tuned MySQL settings. | ||
== MySQL Performance Settings == | |||
For high-performance | For high-performance operation with partitioning: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="ini"> | ||
[mysqld] | [mysqld] | ||
# Use 50-70% of available RAM for caching | # Use 50-70% of available RAM for caching | ||
| Line 266: | Line 300: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
For comprehensive | For comprehensive tuning, see [[Scaling|Scaling and Performance Guide]]. | ||
== See Also == | |||
* [[Sniffer_configuration|Sniffer Configuration Reference]] | |||
* [[Scaling|Scaling and Performance Guide]] | |||
* [[SQL_queue_is_growing_in_a_peaktime|SQL Queue Troubleshooting]] | |||
* [[Sniffer_troubleshooting|Sniffer Troubleshooting]] | |||
== AI Summary for RAG == | == AI Summary for RAG == | ||
'''Summary:''' | '''Summary:''' VoIPmonitor has two independent data retention mechanisms: (1) Filesystem cleaning for PCAP files using <code>maxpoolsize</code>/<code>maxpooldays</code> parameters, running every 5 minutes to delete oldest data first; (2) Database cleaning using <code>cleandatabase</code> parameter with daily partitioning for instant partition drops. Troubleshooting covers disk full scenarios (check with <code>du -h --max-depth=1</code>, increase <code>maxpoolsize</code>), space not reclaimed issues (<code>innodb_file_per_table</code> setting), and database health monitoring (SQLq/SQLf metrics). | ||
'''Keywords:''' data retention, cleaning, delete old calls | |||
'''Keywords:''' data retention, cleaning, delete old calls, disk space, spooldir, maxpoolsize, maxpooldays, cleandatabase, partitioning, reindexfiles, innodb_file_per_table, SQLq, SQLf | |||
'''Key Questions:''' | '''Key Questions:''' | ||
* How do I automatically delete old PCAP files | * How do I automatically delete old PCAP files? | ||
* What is the difference between | * What is the difference between maxpoolsize and maxpooldays? | ||
* My spool directory is full | * My spool directory is full but old files are not deleted - how to fix? | ||
* How do I | * How do I configure database retention with cleandatabase? | ||
* Why is disk space not reclaimed after MySQL cleanup? | |||
* Why is | * What do SQLq and SQLf metrics mean? | ||
* What do SQLq and SQLf metrics mean | |||
Revision as of 19:04, 4 January 2026
This guide explains how VoIPmonitor manages data retention for both captured packets (PCAP files) and Call Detail Records (CDRs) in the database. Proper configuration is essential for managing disk space and maintaining long-term database performance.
Overview
VoIPmonitor generates two primary types of data that require periodic cleaning:
- PCAP Files: Raw packet captures of SIP/RTP/GRAPH data stored on the filesystem in the spool directory. These can consume significant disk space.
- CDR Data: Call metadata stored in the MySQL database. Large tables can slow down GUI performance if not managed properly.
The system uses two separate, independent mechanisms to manage the retention of this data:
Filesystem Cleaning (PCAP Spool Directory)
The sensor stores captured call data in a structured directory tree on the local filesystem.
Spool Directory Location
By default, all data is stored in /var/spool/voipmonitor. This location can be changed by setting the spooldir option in voipmonitor.conf.
Retention Configuration
The cleaning process runs automatically every 5 minutes and removes the oldest data based on the rules you define in voipmonitor.conf. You can set limits based on total size (in Megabytes) or age (in days). If both a size and day limit are set for the same data type, the first limit that is reached will trigger the cleaning.
| Parameter | Default Value | Description |
|---|---|---|
maxpoolsize |
102400 (100 GB) | The total maximum disk space for all captured data (SIP, RTP, GRAPH, AUDIO). |
maxpooldays |
(unset) | The maximum number of days to keep all captured data. |
maxpoolsipsize |
(unset) | A specific size limit for SIP PCAP files only. |
maxpoolsipdays |
(unset) | A specific age limit for SIP PCAP files only. |
maxpoolrtpsize |
(unset) | A specific size limit for RTP PCAP files only. |
maxpoolrtpdays |
(unset) | A specific age limit for RTP PCAP files only. |
maxpoolgraphsize |
(unset) | A specific size limit for GRAPH files only. |
maxpoolgraphdays |
(unset) | A specific age limit for GRAPH files only. |
maxpoolaudiosize |
(unset) | A specific size limit for converted audio files (WAV/OGG) only. |
maxpoolaudiodays |
(unset) | An age limit for converted audio files (WAV/OGG) only. |
Troubleshooting: Disk Full / Files Disappearing
If you see errors when attempting to extract older calls from the GUI, or if call files are disappearing too quickly, your spool directory may have reached its size limit.
Diagnosis: Check Disk Usage
- Identify the sensor/probe responsible for the missing data.
- SSH into the sensor/probe and navigate to the spooldir.
- Check the disk usage:
cd /var/spool/voipmonitor
du -h --max-depth=1 ./
# Example output:
# 150G ./2025-01
# 120G ./2024-12
# 90G ./2024-11
# 360G .
- Compare with the configured limit:
grep maxpoolsize /etc/voipmonitor.conf
# Example output: maxpoolsize = 102400 (100 GB in MB)
Resolution: Increase Spooldir Size
If the actual usage exceeds the configured limit, increase maxpoolsize:
# Edit /etc/voipmonitor.conf
[general]
maxpoolsize = 716800 # 700 GB in MB
maxpooldays = 90 # Optional: Keep data for last 90 days
Apply changes:
systemctl restart voipmonitor
Maintenance: Re-indexing the Spool Directory
VoIPmonitor maintains an index of all created PCAP files to perform cleaning efficiently without scanning the entire directory tree. If this index becomes corrupt, or if you manually move files into the spool, old data may not be deleted correctly.
To trigger a manual re-index via the manager API:
# Open a manager API session
echo 'manager_file start /tmp/vmsck' | nc 127.0.0.1 5029
# Send the re-index command
echo reindexfiles | nc -U /tmp/vmsck
Note: This command requires netcat with support for UNIX sockets (-U). For alternative methods, see the Manager API documentation.
Database Cleaning (CDR Retention)
Managing the size of the cdr table and other large tables is critical for GUI performance.
Partitioning Method (Recommended)
Since version 7, VoIPmonitor utilizes database partitioning, which splits large tables into smaller, daily segments. This is the recommended method for managing database retention.
| Aspect | Description |
|---|---|
| How it works | Set cleandatabase = 30 in voipmonitor.conf to keep the last 30 days of data.
|
| Why it's better | Dropping old partitions is instantaneous (milliseconds), regardless of row count. Zero database load. |
| Requirement | Partitioning is enabled by default on new installations. |
Quick Start: Global Retention
For most deployments, configure one parameter in /etc/voipmonitor.conf:
# Keep all records for 30 days
cleandatabase = 30
The cleandatabase parameter acts as a global default for all cleandatabase_* options and applies to:
cdr- Call Detail Recordsmessage- SIP MESSAGE textssip_msg- SIP OPTIONS/SUBSCRIBE/NOTIFY messagesregister_state- SIP registration statesregister_failed- Failed registration attempts
Retention Parameters
| Parameter | Default | Description |
|---|---|---|
cleandatabase |
0 (disabled) | Master retention setting in days. |
cleandatabase_cdr |
0 | Specific retention for cdr and message tables.
|
cleandatabase_rtp_stat |
2 | Retention for detailed RTP statistics. |
cleandatabase_sip_msg |
0 | Retention for OPTIONS/SUBSCRIBE/NOTIFY. |
cleandatabase_size |
(unset) | Alternative: size-based limit in MB (requires version 2024.05.1+). |
partition_operations_enable_fromto |
1-5 | Time window for partition operations (e.g., 1-5 AM). |
More details: Sniffer Configuration - Database Cleaning.
Legacy Method: Manual Deletion (Not Recommended)
For very old, non-partitioned databases, you would need custom scripts with DELETE FROM cdr WHERE calldate < ... queries.
Warning: Manual DELETE on large tables is extremely slow and resource-intensive. A single operation on millions of rows can take hours and impact GUI performance.
Troubleshooting Disk Space Issues
Disk Space Not Reclaimed After Cleanup
If automatic cleanup runs but disk space is not freed from the MySQL data directory, check the innodb_file_per_table setting:
SHOW GLOBAL VARIABLES LIKE 'innodb_file_per_table';
| Value | Behavior |
|---|---|
| ON | Each table/partition has its own .ibd file. Dropping partitions reclaims space immediately.
|
| OFF | All data in shared ibdata1 file. Dropping partitions does not reduce file size.
|
Solutions
- Option 1
- Enable for Future Tables
Add to /etc/my.cnf or /etc/mysql/my.cnf:
[mysqld]
innodb_file_per_table = 1
systemctl restart mysql
Note: This only affects NEW tables/partitions. Existing data in ibdata1 remains.
- Option 2
- Reclaim Space from Existing Tables
OPTIMIZE TABLE cdr;
Warning: Requires significant free disk space to duplicate table data. May crash if disk is nearly full.
- Option 3
- Export and Re-import
mysqldump -u root -p voipmonitor > voipmonitor_backup.sql
mysql -u root -p -e "DROP DATABASE voipmonitor; CREATE DATABASE voipmonitor;"
mysql -u root -p voipmonitor < voipmonitor_backup.sql
Monitoring Database Health
SQL Queue Metrics
The sensor tracks queue metrics visible in GUI → Settings → Sensors → Status:
| Metric | Description | Healthy Range |
|---|---|---|
| SQLq | CDRs waiting to be written to database | Near 0, sporadic spikes OK |
| SQLf | Failed database write attempts | Zero (not growing) |
- Consistently high/growing SQLq → database cannot keep up
- Non-zero/growing SQLf → database errors or connectivity issues
See SQL Queue Troubleshooting for details.
System Monitoring
# Check system load
cat /proc/loadavg
# Monitor disk I/O (shows only active processes)
iotop -o
High I/O from mysqld processes may indicate slow storage or poorly tuned MySQL settings.
MySQL Performance Settings
For high-performance operation with partitioning:
[mysqld]
# Use 50-70% of available RAM for caching
innodb_buffer_pool_size = 4G
# Flush logs to OS every second (faster, safe for VoIPmonitor)
innodb_flush_log_at_trx_commit = 2
# Enable per-table filespace for easy space reclamation
innodb_file_per_table = 1
For comprehensive tuning, see Scaling and Performance Guide.
See Also
- Sniffer Configuration Reference
- Scaling and Performance Guide
- SQL Queue Troubleshooting
- Sniffer Troubleshooting
AI Summary for RAG
Summary: VoIPmonitor has two independent data retention mechanisms: (1) Filesystem cleaning for PCAP files using maxpoolsize/maxpooldays parameters, running every 5 minutes to delete oldest data first; (2) Database cleaning using cleandatabase parameter with daily partitioning for instant partition drops. Troubleshooting covers disk full scenarios (check with du -h --max-depth=1, increase maxpoolsize), space not reclaimed issues (innodb_file_per_table setting), and database health monitoring (SQLq/SQLf metrics).
Keywords: data retention, cleaning, delete old calls, disk space, spooldir, maxpoolsize, maxpooldays, cleandatabase, partitioning, reindexfiles, innodb_file_per_table, SQLq, SQLf
Key Questions:
- How do I automatically delete old PCAP files?
- What is the difference between maxpoolsize and maxpooldays?
- My spool directory is full but old files are not deleted - how to fix?
- How do I configure database retention with cleandatabase?
- Why is disk space not reclaimed after MySQL cleanup?
- What do SQLq and SQLf metrics mean?