Here, we will try to talk about the main configuration parameters for frontend performance used by Zabbix. When considering basic items to ensure acceptable performance from the implementation of Zabbix, we basically have to activate the compression modules (mod_compress
, mod_gzip
, mod_deflate
, and so on) in those web servers in this chapter.
For Apache, it is important to ensure that we are with the active compression module. Therefore, we must verify that mod_deflate
and/or mod_gzip
are installed and configured.
In httpd.conf
(the location will vary according to your operational system), perform these steps:
[root]# grep deflate_module /etc/httpd/conf/httpd.conf LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xml+rss AddOutputFilterByType DEFLATE text/javascript # Don't compress images SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary </IfModule>
Basically, we are telling Apache that if mod_deflate
is active, compact the types of files in AddOutputFilterByType
and don't compress the images that are usually compressed.
In lighttpd, there is a feature ensuring module compression does not compact native dynamic content (PHP files, for example, will not be compressed). It is then necessary to enable compression of PHP itself.
Another important point is related to the fact that mod_compress
creates a cache with the compressed files to accelerate the next request (remember that the dynamic content is not compressed by mod_compress
). This is what we should check:
In lighttpd.conf
, or in modules.conf
(the location will vary according to your operating system), perform the following steps:
server.modules = ( ... "mod_compress", ... )
[root]# grep ^compress /etc/lighttpd/lighttpd.conf compress.cache-dir = "/tmp/cache/lighttpd/compress/" compress.filetype = ("application/x-javascript", "text/css", "text/html", "text/plain", "text/xml", "text/javascript")
In php.ini
(the location will vary according to your operational system), use the following command:
[root]# grep "zlib.output_compression" /etc/php.ini ... zlib.output_compression = On ...
In Nginx, using nginx.conf
(the location will vary according to your operational system), execute the following command:
[root]# grep gzip /etc/nginx/nginx.conf gzip on; gzip_comp_level 4; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;