Making your Frontend Faster
A simple way to make your Zabbix Frontend faster is install a PHP cache on WebServer, and to do it I recommend eAccelerator:
eAccelerator is a free open-source PHP accelerator & optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.
For complete documentation and information, please visit http://eaccelerator.net/
Installation Tips
- Don’t forget to restart the WebServer daemon (eg. Apache)
- Source installation requires phpize utility, you can find it on php-devel package
- Make sure that it’s all fine looking for eAccelerator information on a phpinfo() page
GZip Compression
Many pages on Zabbix outputs very large HTML content, using gzip compression (mod_deflate) is possible to reduce the network traffic significantly. On a simple test I reduced my Overview from 23k to 4k.
This is a cookbook configuration for Apache 2.2:
<Location /zabbix>
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
Benchmark Tests using AB (Apache Benchmark)
- with eAccelerator
[root@localhost ~]# ab -c 50 -n 500 http://localhost/zabbix/overview.php
Time taken for tests: 7.363274 seconds
- without eAccelerator
[root@localhost ~]# ab -c 50 -n 500 http://localhost/zabbix/overview.php
Time taken for tests: 15.781082 seconds