# Does this configuration have impact in performance?

**URL:** <https://www.ruby-forum.com/t/does-this-configuration-have-impact-in-performance/214457>\
**Category:** NGINX\
**Created:** [December 2, 2011, 11:25am UTC](https://www.ruby-forum.com/t/does-this-configuration-have-impact-in-performance/214457 "2011-12-02T11:25:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [December 2, 2011, 11:25am UTC](https://www.ruby-forum.com/t/does-this-configuration-have-impact-in-performance/214457/1 "2011-12-02T11:25:23Z")

</div>

Hello,

I have two small bits in my configuration that I’m worried about.  
One it to redirect users based in their country to a specific page.  
The other is to choose the upstream based in a cookie.

'm am worried about performance and would like to know if this small  
bits are evil to my site.

================================

### Map Member ID Cookie

map $cookie\_memberid $prxy {  
default upstream-1;  
~^[1-9]\d\*$ upstream-2;  
}

### / Map Member ID Cookie

### Map Country Code

map “$geoip\_country\_code.$arg\_section” $registo {  
default 0;  
AAA.register 1;  
BBB.register 1;  
}

map “$geoip\_country\_code.$arg\_serviceClick” $registo {  
default 0;  
AAA.facebook 1;  
BBB.facebook 1;  
}

### / Map Country Code

server {

```
    # Main location
    location / {

        # GeoIP
        if ($registo) {
            return 301 /pages/registo;
        }

        proxy_pass http://$prxy;

```

# }

Thanks

Posted at Nginx Forum:

> **[Does this configuration have impact in performance?](https://forum.nginx.org/read.php?2,219466,219466#msg-219466)**
>
> Hello, I have two small bits in my configuration that I'm worried about. One it to redirect users based in their country to a specific page. The other is to choose the upstream based in a cookie. 'm am worried about performance and would like to know...
