[omd-users] OMD web performance suggestion (+nginx)
Andriy Kopystyansky
anri at polynet.lviv.ua
Sun May 31 13:19:33 CEST 2015
Hi people,
a lot of thanks to Mathias Kettner for check_mk.
There was an issue in this list earlier about performance of the
web-site runnig OMD, and the one noticeable cause was mentioned
apache. The same was for me. Not going to say anything bad about
apache, i guess we could do manage things a little better. The idea
for now is using nginx as reverse-proxy to serve all static content,
still using Apache as the application server for php and python
scripts (perhaps, it could be ruled out with fastcgi later).
Since OMD itself is quite resource-consuming, it is hard to imagine
someone will use this server (either bare-metal or virtual) for
somewhat else purpose than OMD. So, OMD setup script could disable
system's httpd and install nginx instead with approximately following
server config /etc/nginx/conf.d/virtual.conf:
server {
listen 80;
access_log off;
# nginx can handle static
location ~ ^/(.*)/check_mk/(.*\.(gif|jpg|png|css|js))$ {
alias /omd/sites/$1/share/check_mk/web/htdocs/$2;
}
location ~ ^/(.*)/pnp4nagios/(.*\.(gif|jpg|png|css|js))$ {
alias /omd/sites/$1/share/pnp4nagios/htdocs/$2;
}
location ~ ^/(.*)/nagvis/(.*\.(gif|jpg|png|css|js))$ {
alias /omd/sites/$1/share/nagvis/htdocs/$2;
}
# all the rest goes to OMD's apache
location / {
proxy_pass http://localhost:5000/;
}
}
#
Also /etc/nginx/nginx.conf should be tweaked to at least
worker_processes 4; #8;
and
events {
use epoll; #we are on Linux, yeah?
}
#
Such schema works notably faster for me...
--
best regards,
Andriy Kopystyansky.
More information about the omd-users
mailing list