Welcome! Log In Create A New Profile

Advanced

performance using variables?

Ingo Baab
May 02, 2017 08:04AM
Hello List!

I got a question regarding performance of my nginx configuration files
using variables.
Will there be any slow LUA-runtime-parsing if I set a variable $phpuser
inside my server
block and use it afterwards in several common config files.

Q: Is this a performance disadvantage?

upstream php7_wpexpress_de {
server unix:/var/run/php7.0-fpm-wpexpress_de.sock;
}

server {
set $phpuser "wpexpress_de";

server_name wpexpress.dewww.wpexpress.de;

access_log /var/log/nginx/wpexpress.de.access.log rt_cache;
error_log /var/log/nginx/wpexpress.de.error.log;

root /var/www/wpexpress.de/htdocs;

index index.php index.html index.htm;

include common/redis-php7.conf;
include common/wpcommon-php7.conf;
include common/locations-php7.conf;
}

In the bottom (three) included config-files I subsequently use

fastcgi_pass php7_$phpuser;

because they do not distinguish per virtual host except for the
php-upstream.
Is this a good approach to separate php processors for each virtual host
or should
I do all configuration better static? Thank you in advance for any
helpfull information,

Ingo Baab, https://baab.de
______
I did read: http://nginx.org/en/docs/faq/variables_in_config.html and
also found guys suggesting a global var with nginx-config utilizing map:
http://stackoverflow.com/questions/14433309/how-to-define-a-global-variable-in-nginx-conf-file

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

performance using variables?

Ingo Baab May 02, 2017 08:04AM

Re: performance using variables?

Francis Daly May 03, 2017 04:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 292
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready