Welcome! Log In Create A New Profile

Advanced

Re: map module - mass hosting

Maxim Dounin
April 23, 2014 10:36AM
Hello!

On Wed, Apr 23, 2014 at 09:27:33AM -0400, beatnut wrote:

[...]

> > Searching within a map is basically identical to searching for
> > appropriate server{} block, both use the same internal mechanism
> > (ngx_hash). As long as you don't use regular expressions,
> > lookup complexity is O(1).
>
> So using for example:
>
> .example.com
> or
> example.*
>
> have more complexity or it shoud have full list of subdomains for better
> performance:
>
> www.example.com
> example.com
> example.somedomain.com

While wildcards require more work on each lookup, complexity is
still O(1). Note that regular expressions != wildcard names.

> > Distinct server{} blocks might be more CPU-efficient due to no need to
> >
> > evaluate variables and dynamically allocate memory for resulting
> > strings on each request.
>
> My configuration include one file with server{} per domain.
> exaple.com.conf
> example2.conf
> etc
>
> The main improvement i'd like to implement is to have one file with php
> config like fastcgi.conf above and then include it in every server{}
> Map module gives me this opportunity.

This is not something I would recommend to do. If you have
server{} block per domain, you should have enough data to write
configuration without introducing another map ($document_root,
$server_name, and so on).

Please also see this FAQ article:

http://nginx.org/en/docs/faq/variables_in_config.html

--
Maxim Dounin
http://nginx.org/

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

map module - mass hosting

beatnut April 23, 2014 08:07AM

Re: map module - mass hosting

Maxim Dounin April 23, 2014 08:46AM

Re: map module - mass hosting

beatnut April 23, 2014 09:27AM

Re: map module - mass hosting

Maxim Dounin April 23, 2014 10:36AM

Re: map module - mass hosting

beatnut April 24, 2014 02:51AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
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