Znuny Health Check & Performance Tuning
Slow load times or high server load? We optimize database queries, indexing, caching, and daemon workers for noticeably faster response times.
In this in-depth guide, we cover all relevant layers for a scalable and high-performance Znuny installation:
Kernel::System::Ticket::IndexAccelerator::RuntimeDBticket tableKernel::System::Ticket::IndexAccelerator::StaticDBticket_index table with token columns (subject, status, owner, etc.)Kernel::System::Ticket::IndexAccelerator::RuntimeDBtickettime commandKernel::System::Ticket::IndexAccelerator::StaticDB| Setting | Value | Purpose |
|---|---|---|
| Ticket::SearchIndex::IndexArchivedTickets | 0 (off) | Exclude archived tickets |
| Ticket::SearchIndex::Attribute.WordCountMax | 1000 | Index first 1000 words |
| Ticket::SearchIndex::Filters | Standard | Regex filter for special chars |
| Ticket::SearchIndex::StopWords###Custom | de, en | Add custom stopwords |
ticket_indexFor large data volumes (>10M articles), Elasticsearch is recommended.
time
keyword
keyword type for rarely changed fields (e.g., ticket IDs)text + analyzer for free text| Backend | Storage Location | Use Case |
|---|---|---|
| DB | MySQL/MariaDB | < 10k attachments, single-server |
| FS | local FS / NFS / SAN | ≥ 10k attachments, multi-server, high IOPS |
text
/opt/znuny/var/log/article_storage.logznuny (UID 1000)Actively reduces indexed data records.
Ticket::ArchiveSystem = 1State = close AND Changed < now-6monanalyzer/opt/znuny/var/log/article_storage.logcpan install Redis::Fastznuny/opt/znuny/var/tmpTicket::ArchiveSystem = 1
Edit /etc/my.cnf.d/znuny.cnf:
State = close
Script: /usr/local/bin/znuny_monitor.sh
Changed < now-6mon
Cron (hourly):
cpan install Redis::Fast
/opt/znuny/var/tmp
Cron: daily 1:00 AM
znuny-agent metrics (ResponseTime, QueueDepth)max_connectionsWith this comprehensive performance tuning plan covering index, search, storage, cache, database, and infrastructure layers, you will achieve a stable and fast platform in Znuny that scales smoothly even with millions of tickets and articles.
Znuny Health Check & Performance Tuning
Slow load times or high server load? We optimize database queries, indexing, caching, and daemon workers for noticeably faster response times.
You should consider switching from RuntimeDB to StaticDB when your Znuny installation has approximately 80,000 or more open tickets. RuntimeDB, the standard module, performs dynamic queries directly on the ticket table, leading to query times that increase linearly with the number of tickets. In contrast, StaticDB uses a precompiled ticket_index table, which includes tokenized columns for subject, status, owner, and other attributes. This approach ensures constant query times, regardless of the growing number of tickets. After switching, an initial indexing is required, and a daily cron job (e.g., at 02:30 AM) should be set up to rebuild the index. For further optimization, enable automatic partial rebuilds only for changed queues via SysConfig.
Quellen / Sources:
No, Elasticsearch is not mandatory for Znuny's full-text search. Znuny includes an internal full-text index that is sufficient for most installations. You can rebuild this internal index using a specific command and configure it with SysConfig settings like Ticket::SearchIndex::IndexArchivedTickets (set to 0 to exclude archived tickets) and Ticket::SearchIndex::Attribute.WordCountMax (to index the first 1000 words). Elasticsearch becomes recommended for very large data volumes, typically exceeding 10 million articles, where its advanced capabilities and scalability offer significant benefits. When using Elasticsearch, critical optimizations include setting JVM Heap Size (Min = Max, and Max ≤ 50% of physical RAM), configuring Disk Watermarks (low/high for shard allocation, flood_stage for read-only indices), and optimizing mapping types (e.g., keyword for IDs, text with analyzer for free text).
Quellen / Sources:
Ticket archiving significantly improves Znuny performance by actively reducing the number of data records that need to be indexed and queried. This ensures that queue views and searches remain fast, even on large installations with millions of tickets. To set up ticket archiving, first enable it in SysConfig by setting Ticket::ArchiveSystem = 1. Next, configure a GenericAgent job to automate the archiving process. It's recommended to limit each run to a maximum of 5,000 tickets and apply a filter such as State = close AND Changed < now-6mon to archive older, closed tickets. Finally, schedule this GenericAgent job via a cron entry, for example, weekly on Monday at 4:00 AM, to ensure regular maintenance and sustained performance.
Quellen / Sources:
Choosing the right article storage backend is crucial for Znuny's performance. The DB backend (MySQL/MariaDB) is suitable for installations with fewer than 10,000 attachments and single-server setups. For larger installations, specifically those with 10,000 or more attachments, or multi-server environments requiring high IOPS, the FS backend (local FS / NFS / SAN) is recommended. When switching between DB and FS, it's essential to monitor the process by checking the /opt/znuny/var/log/article_storage.log for any errors or progress updates. Additionally, pay close attention to file permissions, ensuring that the znuny user (typically UID 1000) has the necessary read and write access to the new storage location to prevent issues with article retrieval and storage.
Quellen / Sources:
Caching mechanisms like Redis and Ramdisk can significantly enhance Znuny's performance by reducing the load on the database and speeding up access to frequently used data. For Redis Cache, the setup involves three main steps: first, install Redis on your server; second, install the necessary Perl module by running cpan install Redis::Fast; and third, configure Redis in Znuny's SysConfig. This allows Znuny to store session data, configuration, and other temporary information in a fast in-memory cache. Additionally, utilizing a Ramdisk for /opt/znuny/var/tmp can further boost performance. By mounting a portion of your RAM as a temporary file system, operations involving temporary files (which Znuny frequently uses) become much faster than writing to a traditional disk, leading to quicker overall response times and reduced I/O bottlenecks.
Quellen / Sources:
Optimizing your MySQL/MariaDB database is a cornerstone of Znuny performance. While specific parameters depend on your server's hardware and workload, the general approach involves editing the configuration file, typically located at /etc/my.cnf.d/znuny.cnf. Key areas for tuning often include innodb_buffer_pool_size (to allocate sufficient memory for data and index caching), innodb_log_file_size (to optimize write performance), and max_connections (to handle concurrent user loads). It's crucial to benchmark your changes using tools like TPC-C or sysbench to simulate load and validate that your tuning efforts yield tangible performance improvements without introducing instability. Monitoring metrics such as InnoDB Buffer Pool usage is vital to ensure efficient memory utilization and identify potential bottlenecks.
Quellen / Sources: