The main configuration parameters

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.

Compression in Apache

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:

  • Check whether the module is active:
    [root]# grep deflate_module /etc/httpd/conf/httpd.conf
    LoadModule deflate_module modules/mod_deflate.so
  • Add it to Zabbix's virtual host:
    <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.

Compression in lighttpd

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:

  • Verify that the module is active:
    server.modules = (
      ...
      "mod_compress",
      ...
    )
  • Adjust the module configuration:
    [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
...

Compression in Nginx

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;
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset