Forum: NGINX Caching servers in Local ISPs!

13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-09 16:59
(Received via mailing list)
Hello,

      We're running a high traffic website similar to youtube.com. Due
to
high bandwidth utilization over the network, we're in contact with the
local ISP in order to put caching server to reduce bandwidth utilization
for file streaming. Our main front end content servers (nginx) are
located
in U.S and we want to put caching servers in ASIA as most of the traffic
is
originating from asia.

We've no idea how this caching would work. Would the caching servers
will
be configured and deployed by Local ISP ? or we're required to do some
work
with our application coding ?

I know it is bit off topic on nginx forum. But this is the only forum
that
is intensively active and helpful.

Please guide me a bit, i am new to this caching environment.

Shahzaib
41d49f737346c100d3fb863177997957?d=identicon&s=25 Rainer Duffner (Guest)
on 2014-05-09 19:19
(Received via mailing list)
Am 09.05.2014 um 16:58 schrieb shahzaib shahzaib
<shahzaib.cb@gmail.com>:

> Hello,
>
>       We're running a high traffic website similar to youtube.com. Due to high
bandwidth utilization over the network, we're in contact with the local ISP in
order to put caching server to reduce bandwidth utilization for file streaming.
Our main front end content servers (nginx) are located in U.S and we want to put
caching servers in ASIA as most of the traffic is originating from asia.
>
> We've no idea how this caching would work. Would the caching servers will be
configured and deployed by Local ISP ? or we're required to do some work with 
our
application coding ?
>
> I know it is bit off topic on nginx forum. But this is the only forum that is
intensively active and helpful.
>
> Please guide me a bit, i am new to this caching environment.
>



I think you would need to move your DNS to somebody like easydns.com or
dyn.com (just of the top of my head, there are probably lots more) and
use their geo-location feature.

That way, somebody with an IP from Asia will receive the  IP of your
Asian server when it asks DNS about the IP of your domain-name.

Maybe somebody who has done this before can comment - Ive looked into
it, but never seriously.

;-)
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-09 19:45
(Received via mailing list)
@Rainer, we're already in contact with one of our Country's ISP(80% of
the
country users are using that ISP services) .So, they can do much better
work than the DNS sites you provided because we only required caching
for
our country.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-05-09 20:50
(Received via mailing list)
Its quite simple, think of it this way, a DNS entry does not have to
point
to the same IP everywhere.

Place your cache machines at a ISP, have them assign its IP to your
preferred dns name, thats about it.

The rest like distribution works like a reverse riverbed with a master
mirror, rsync or the likes.

And of course this can all be done with nginx at all locations.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250000#msg-250000
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-09 21:22
(Received via mailing list)
@itpp thanks for replying.

So on easy note, i would have to assign those machines the preferred dns
and use rsync on regular basis in order to make identical data  between
local caching machines and main front end content servers ?

What if a client request a video which is not in local caching server ?
Does nginx has the configuration for it to check the files locally and
then
forward the request to main content servers if requested file is not
cached
locally ?

I need a bit of guidance in order to configure nginx this way.

Shahzaib
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-05-09 22:02
(Received via mailing list)
> So on easy note, i would have to assign those machines the preferred
> dns
> and use rsync on regular basis in order to make identical data
> between
> local caching machines and main front end content servers ?

Yep.

> What if a client request a video which is not in local caching server
> ?

You need to maintain a cache index on each cache machine in order to
determine what is available to the users, for most content you need to
do
this anyway since not all content can legally be everywhere and you also
might want to customize what you present for each region.

> Does nginx has the configuration for it to check the files locally and
> then
> forward the request to main content servers if requested file is not
> cached
> locally ?

There are many ways to do this with nginx and Lua but a independent
cache
index would be much better, with it you can do much more like redirect a
content source from elsewhere depending on load and demand. You simply
feed
nginx the cache index. A very simplistic cache index system is abusing a
local (local to nginx) dns server, assign local IP's to resources and
change
them according to load and demand. Again for a local DNS you can assign
whatever you want to a dns name, with a local ttl of 15 seconds and
nginx
loadbalancing between 4 regional resources it will be peanuts to change
the
load based on demand (provided you have monitoring in place which can
act on
such data). Basically a DIY BGP :)

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250002#msg-250002
671d9faabfe3d3382be736b93fbfa1d5?d=identicon&s=25 Steve Holdoway (Guest)
on 2014-05-10 06:25
(Received via mailing list)
You might want to look at lsyncd - a GZSOC project - to ease the
synchronisation. I have had good results with it.

Steve
On Sat, 2014-05-10 at 00:22 +0500, shahzaib shahzaib wrote:
> locally and then forward the request to main content servers if
>
>         The rest like distribution works like a reverse riverbed with
>         nginx mailing list
>         nginx@nginx.org
>         http://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

--
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-10 11:20
(Received via mailing list)
Thanks for replying guyz.

Can i use nginx (origin and edge) ? As the question in following link.

http://stackoverflow.com/questions/10024981/distri...

If i use the origin and edge method, i think i'll change my application
codes to redirect local country traffic to edge webservers (ISP caching
server for video files) and that edge server will check if the requested
file is not in cache and it'll fetch the requested video file from
origin
web-server located in U.S and cache it to local.

For this procedure,

I'll have to configure DNS A entries against local ISP caching servers
and
put those DNS to my application code to stream videos from those LOCAL
CACHING SERVERS for specific country.

Please correct me if i am wrong.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-05-10 12:40
(Received via mailing list)
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-27 12:13
(Received via mailing list)
Hello ,

    Came after a long time to this thread. I have finished the caching
method. I've used bind-geoip to resolve all requests from asia against
the
local ISP caching server ips. Now, here's the most critical part.
Suppose a
request came from asia for the video file which is not yet downloaded on
local caching server, how will the local nginx will deal with it ? I
want
it to forward that request to the main Server and keep forwarding
request
until the next rsync runs and new files propagate to the local caching
server.

Please point me to some nginx guide if this feature works well with
nginx.

Regards.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-05-27 12:56
(Received via mailing list)
I'd call that provisioning, a simple try_files directive can deal with
that
while the provisioning service syncs.
http://nginx.org/en/docs/http/ngx_http_core_module...

Then jump left for cached contents or jump right for non-cached
contents.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250385#msg-250385
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-27 14:17
(Received via mailing list)
@itpp, thanks for reply. I am working on proxy_cache . My all webservers
in
local ISP will be proxy servers and all requests regarding flv,mp4,jpeg
from asia will be route through the proxy servers and data will be cache
in
proxy servers. I think, this will help me with caching. I am testing it
on
local and its working as it should. Following is the edge server config
:

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:1000m;
proxy_temp_path /tmp;


server {
    listen       80;
    server_name  edge.com;
#       proxy_cache one;
        root /var/www/html/test;
access_log /var/log/nginx/access.log ;
    error_log /var/log/nginx/error.log;



 location / {
        proxy_pass http://origin.com:80;
        proxy_cache static;
        proxy_cache_min_uses 1;
            proxy_cache_valid 200 301 302 120m;
#            proxy_cache_valid 404 1m;

   }
}

Please let me know if the method is correct.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-05-27 15:01
(Received via mailing list)
I'm not seeing where you determine if a file is present on an edge
system,
the try_files directive allows you to redirect or not (locally present
or
not). I don't really see a point for using (proxy)cache, the file is
present
or it is not.

location / {
try_files $uri @getfrom_origin;
}

location @getfrom_origin {
proxy_pass ......;
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250393#msg-250393
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-27 15:28
(Received via mailing list)
Hello itpp,

           the Local caching server is nothing but a proxy server which
will route all traffic from asia to origin server and will cache the
requested file in /data/nginx/cache folder. So when the request made
again,
it'll be served from cache.

>>I'm not seeing where you determine if a file is present on an edge system,
Edge system will route request for new file to origin server and will
cache
the resulted file to edge server,so  when the new request for same file
will arrive, nginx edge server will serve it from /data/nginx/cache
folder.

I did experiment on locally and by checking the logs, i think its
working .
I got hint from following link :

http://nginx.com/resources/admin-guide/caching/
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-05-27 15:42
(Received via mailing list)
Of course this will work but when nginx restarts or the cache gets
damaged/corrupted the whole shebang starts again.... And you can't
control
the cached files versus try_files and a normal filesystem.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250395#msg-250395
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-28 10:47
(Received via mailing list)
Thanks itpp. So according to you the more preferable way is non-caching
replication of main content servers to local ISP servers and than run
rsync
periodically for replication. So if file not found in local ISP nginx,
it
should forward request to main content server using try_files method ?
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-28 11:18
(Received via mailing list)
@itpp22, proxy_cache is eating too much memory and cpu on local testing.
1
nginx process was using 1G of Ram and load-avg reached to 22, eventually
local server got killed.

Local server specs are : 8cores and 4G ram.

Looks like proxy_cache will not be suitable method for 3000+ concerrent
connections on local ISP caching server.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-05-28 11:51
(Received via mailing list)
shahzaib1232 Wrote:
-------------------------------------------------------
> Thanks itpp. So according to you the more preferable way is
> non-caching
> replication of main content servers to local ISP servers and than run
> rsync
> periodically for replication. So if file not found in local ISP nginx,
> it
> should forward request to main content server using try_files method ?
>
> @itpp22, proxy_cache is eating too much memory and cpu on local testing.
1
> nginx process was using 1G of Ram and load-avg reached to 22, eventually
> local server got killed.

> Local server specs are : 8cores and 4G ram.

> Looks like proxy_cache will not be suitable method for 3000+ concerrent
> connections on local ISP caching server.

A HLD should have pointed that out :)
You should change your thinking what caching actually is, just because
some
functionality is called 'caching' it doesn't mean anything else is not.

If exist do {
present local via local interfaces
} else {
present remote via remote interfaces
}

Another (none-nginx) process (provisioning) controls which remote
components
flows to local (or is removed) via provisioning interfaces.

Look at something simple like a filesystem with replication, in it's
basics
it's not a cache but more a glorified 2way rsync solution. However
global
files are always local to be determined to which resource you are
connecting
to, yet the filesystem doesn't need to cache much no matter how many
files
it serves, which doesn't defer much from how nxing would work.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250423#msg-250423
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-05-28 13:20
(Received via mailing list)
Right. I'll proceed with my research and get back to you with better
approach . :)
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-04 20:50
(Received via mailing list)
@itpp, i just used your method try_files and it worked flawlessly :).
Following is the testing config :

server {
    listen       80;
    server_name  domain.com;
        root /var/www/html/files;

location / {
        root   /var/www/html/files;
       try_files $uri @getfrom_origin;
    }
location @getfrom_origin {
proxy_pass http://127.0.0.1:8080;
}
}

if proxy_pass worked for localhost, i hope it will also work for remote
host to forward request if the file doesn't exist on local caching
server.
:-)

Would you suggest me to add some more configs for tweaking on nginx ?

Btw, proxy_pass should only be for mp4 and jpeg, cause the caching is
only
for video files.

Should i use rsync or lsync for mirroring the files between Origin and
caching server ?

Suggestion will be highly appreciated.


Regards.
Shahzaib


On Wed, May 28, 2014 at 4:19 PM, shahzaib shahzaib
<shahzaib.cb@gmail.com>
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-06-04 21:20
(Received via mailing list)
shahzaib1232 Wrote:
-------------------------------------------------------
> @itpp, i just used your method try_files and it worked flawlessly :).
> Following is the testing config :
>
> server {
>     listen       80;
>     server_name  domain.com;
>         root /var/www/html/files;
>
> location / {

location ~* (\.mp3|\.avi|\.mp4)$ {

> Should i use rsync or lsync for mirroring the files between Origin and
> caching server ?

Whatever works for you, I'd prefer rsync since that's easier to schedule
for
off-peek hours.
Also sync to a temp folder and move after completion or nginx will
attempt
to send partial files.
see also http://wanproxy.org/

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250645#msg-250645
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-04 21:24
(Received via mailing list)
>>Also sync to a temp folder and move after completion or nginx will attempt
to send partial files.

Oh right. Thanks for quick help and suggestion :). I'll look into
wanproxy
now.
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-06 15:37
(Received via mailing list)
@itpp I am currenlty proceeding with proxy_cache method just because i
had
to done this in emergency mode due to boss pressure :-|. I have a quick
question, can i make nginx to cache files for specific clients ?

Like, if our caching servers are deployed by only single ISP named
"ptcl".
So if ip from ptcl client is browsing video, only his requested file
should
be cached not for any other client, does nginx support that ??

I know its kind of funny, but i've to complete this task :(


On Thu, Jun 5, 2014 at 12:23 AM, shahzaib shahzaib
<shahzaib.cb@gmail.com>
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-06-06 17:26
(Received via mailing list)
shahzaib1232 Wrote:
-------------------------------------------------------
> be cached not for any other client, does nginx support that ??
You could do this based on some IP ranges or via
https://github.com/flant/nginx-http-rdns

See
http://serverfault.com/questions/380642/nginx-how-...
and
http://www.cyberciti.biz/faq/nginx-redirect-backen...

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250707#msg-250707
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-06 17:57
(Received via mailing list)
Thanks a lot itpp. :) I'll look into it and get back to you.

Thanks again for quick solution :)
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-16 19:19
(Received via mailing list)
Hello itpp,i have been  abled to use ngx_http_geo_module. Now the
request
coming from local ISP will first go to the main server (US) and then
main
server will check if the ip is 1.2.3.4 so it'll direct the request to
the
local caching server and than caching server will check if the file is
cached or it should again get the file from main server and cache it
locally.

When i tested it locally, it worked fine but the file URL in firebug is
coming from MAIN server when it should have come from the local caching
server. I can also see the caching directory size increases when the
matching client via geo module is directed to the local caching server
but
the URL remains the same in firebug.

US config :-

geo $TW {
  default 0;
 192.168.1.0/24 1;
}



server {
        listen  80;
        server_name  002.files.com;
#       limit_rate 600k;
        location / {
            root   /var/www/html/files;
            index index.html index.htm index.php;
     #      autoindex on;
}


location ~ \.(mp4|jpeg|jpg)$ {
                mp4;
                root /var/www/html/files;

                 if ($TW) {
                        proxy_pass http://192.168.22.32:80;
                }

                expires 7d;
        valid_referers none blocked  domain.com *.domain.com
blog.domain.com
*.facebook.com *.twitter.com *.files.com *.pump.net domain.tv
*.domain.tv
domainmedia.tv www.domainmedia.tv embed.domainmedia.tv;
                if ($invalid_referer) {
                    return   403;
                }
                }
}

Edge config :-

proxy_ignore_headers "Set-Cookie";
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:100m
                        loader_threshold=300 loader_files=10 inactive=1d
                        max_size=300000m;


proxy_temp_path /data/nginx/tmp 1 2;
add_header X-Cache-Status $upstream_cache_status;
 add_header Accept-Ranges bytes;
max_ranges 512;



server {

        listen       80;
        server_name  192.168.22.32;
        root /var/www/html/files;
        location ~ \.(mp4|jpeg|jpg)$ {
               root   /var/www/html/files;
                mp4;
                try_files $uri @getfrom_origin;

            }


        location @getfrom_origin {
        proxy_pass http://002.files.com:80;
        proxy_cache_valid 200 302   60m;
        proxy_cache_valid any 1m;
        proxy_cache static;
        proxy_cache_min_uses 1;
        }


Maybe i need to add some variable to get original server ip ?



<http://nginx.org/en/docs/http/ngx_http_geo_module.html>
<http://nginx.org/en/docs/http/ngx_http_geo_module.html>


On Fri, Jun 6, 2014 at 8:56 PM, shahzaib shahzaib
<shahzaib.cb@gmail.com>
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-06-16 19:41
(Received via mailing list)
shahzaib1232 Wrote:
-------------------------------------------------------

> Maybe i need to add some variable to get original server ip ?

https://www.google.nl/#q=nginx+geo+remote+ip+address

http://www.cyberciti.biz/faq/nginx-redirect-backen...

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250895#msg-250895
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-17 16:00
(Received via mailing list)
Thanks itpp but the issue is still same and still the ip is from the
main
server in inspect element as well as in local-caching nginx access logs,
i
am getting the client ip as main-server's ip instead of original client
ip
and i am sure that i am doing something wrong. Well i have another
question
now, as our test with CIDR notation worked well with nginx geo module
and
nginx decided to route specific ips to specific server (caching server).

So, the specific subnet coming from our ISP to the main server will be
routed to the local caching server and our ISP will have to tell us each
time to add specific ip prefix in the nginx config to route them towards
their caching server. So the problem is, whenever few hundreds ip
prefixes
are added to their network, they'll have to provide us those prefixes in
order to enable caching for newly added ips.

We just had a chat with our local ISP and he said that you should use
some
services like BGP to automatically detect if any new ip prefixes are
added
to our network and we'll not have to tell you each time we add some ip
prefixes to our network.

Could you guide me how could i make this work in our environment. The
basic
architecture of our network is :-

Two static servers (serving mp4,jpg). One server located in US and one
server located in Local ISP.

I hope you can put me on some track as you did in the past and provide
me
some kick start to work with BGP.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-06-17 19:12
(Received via mailing list)
shahzaib1232 Wrote:
-------------------------------------------------------
> Thanks itpp but the issue is still same and still the ip is from the
> main
> server in inspect element as well as in local-caching nginx access
> logs, i
> am getting the client ip as main-server's ip instead of original
> client ip

It could be the case the traffic you are getting is from the ISP proxy
which
could mean that any traffic is from that ISP only, which makes it easier
to
determine which to serve from local. Ask the ISP from where the traffic
is
coming from, if it is a proxy then proxy=local.

> So, the specific subnet coming from our ISP to the main server will be
> routed to the local caching server and our ISP will have to tell us
> each
> time to add specific ip prefix in the nginx config to route them
> towards
> their caching server. So the problem is, whenever few hundreds ip
> prefixes
> are added to their network, they'll have to provide us those prefixes
> in
> order to enable caching for newly added ips.

See above, if this is not the case look into
https://github.com/flant/nginx-http-rdns if a client has something like
'p1234.adsl-pool2-auckland.au' you can redirect based on a part of the
client dns name, your ISP can tell you which DHCP named pools there are.

If you can't get the client IP of hostname you gonna need to do some
wiresharking to see where the info is, if it is anywhere.
If the ISP is using a proxy to pass clients to your server ask them to
add a
header with the client ip/hostname.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250950#msg-250950
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-17 20:09
(Received via mailing list)
i don't think the solution rdns will be suitable for us. I have checked
the
zebra software to make linux a BGP router
http://www.techrepublic.com/article/use-zebra-to-s...

Could you tell me if BGP is capable of doing what we want? Because our
local ISP supports this method and i have no idea how to implement it.

Functionality we need, is to auto detect the new ip prefixes from local
ISP
so they'll not have to provide us thousands of prefixes on daily basis.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-06-17 20:33
(Received via mailing list)
shahzaib1232 Wrote:
-------------------------------------------------------
> local ISP
> so they'll not have to provide us thousands of prefixes on daily
> basis.

Why not use a DNS for the clients? your making things too complicated.

Client-1-request@ISP-1 -> edge1.streaming.au ISP-1-DNS -> 12.34.56.78
(which
is your edge box)
Client-1-request@ISP-2 -> edge1.streaming.au ISP-2-DNS -> 99.88.77.66
(which
is your box in the US)

Anyone from ISP-1 will always be directed to the edge systems, anyone
else
to where-ever you point the dns.

ISP's also use regional DNS servers which allows you more edge systems
closer to the users.

Anyway, BGP see http://bird.network.cz/ (netflix solution)

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250953#msg-250953
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-17 20:46
(Received via mailing list)
>>Why not use a DNS for the clients?
How i would be sure that request coming from the ISP-1 on the DNS server
and then point it to the local caching server? I mean i can use View
directive of BIND to route specific ips (local ISP clients) to the local
caching server and what if tomorrow the ISP has added more clients to
their
network ? I'll also have those new ip prefixes to DNS server.

Please correct me if i am wrong.
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-17 20:47
(Received via mailing list)
>>Why not use a DNS for the clients?
How i would be sure that request coming from the ISP-1 on the DNS server
?
and then point it to the local caching server? I mean i can use View
directive of BIND to route specific ips (local ISP clients) to the local
caching server and what if tomorrow the ISP has added more clients to
their
network ? I'll also have to add those new ip prefixes to DNS server.


On Tue, Jun 17, 2014 at 11:45 PM, shahzaib shahzaib
<shahzaib.cb@gmail.com>
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-06-17 21:50
(Received via mailing list)
You don't need to do anything with a dns that is only local to the
clients
served by the ISP.

Suppose I am in Africa;
Question to my ISP: I'd like to go to new-york
ISP: new-york is located in south-Africa

Suppose I am in the US;
Question to my ISP: I'd like to go to new-york
ISP: new-york is located in the US

The DNS is just a pointer, where ever you have an edge server make the
dns
name point to it, when not point the dns to origin.
Every ISP client gets the DNS servers from their ISP, its really simple.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,250957#msg-250957
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-18 19:10
(Received via mailing list)
ok, but i have no idea why ISP is asking for BGP and matter of fact is,
i'll have to make BGP work somehow, so local caching server will fetch
the
new subnets from ISP router automatically (and i don't know how).

Btw, our local ISP provided us with some testing ip prefixes to check
nginx
based caching.  i.e
geo {
default 0;
10.0.0.0/8
39.23.2.0/24 1;
112.50.192.0/18 1;
}

Now whenever we add the prefix 112.50.192.0/18 in geo {} , all the
requests
coming from the 39.23.2.0/24 and 10.0.0.0/8 returns 504 gateway error
and
videos failed to stream. To resolve this issue, we have to remove
112.50.192.0/18 1; from geo block.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 itpp2012 (Guest)
on 2014-06-18 20:25
(Received via mailing list)
shahzaib1232 Wrote:
-------------------------------------------------------
>
Typo??

geo {
default 0;
10.0.0.0/8 1;
39.23.2.0/24 1;
112.50.192.0/18 1;
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249997,251019#msg-251019
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-18 20:31
(Received via mailing list)
>>geo {
default 0;
10.0.0.0/8 1;
39.23.2.0/24 1;
112.50.192.0/18 1;
}

Sorry i didn't write accurately here but it is 10.0.0.0/8 1; in nginx
config, so the problem is not the wrong syntax for geo {}.
63f341734581b167c7b698169bdd2510?d=identicon&s=25 Lukas Tribus (Guest)
on 2014-06-18 21:36
(Received via mailing list)
Hi,


> ok, but i have no idea why ISP is asking for BGP and matter of fact is,
> i'll have to make BGP work somehow, so local caching server will fetch
> the new subnets from ISP router automatically (and i don't know how).

I strongly suggest you hire some consultant who can help you setting
all those things up, because this is clearly a task too complex for
a single mailing list thread and some nginx configurations.

Also, why not host those file on a professional CDN instead of in-house?

https://www.google.com/search?q=mp4+streaming+cdn



Lukas
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-18 21:46
(Received via mailing list)
>>why not host those file on a professional CDN instead of in-house?
Because 80% of the traffic is from our country and 50% of that traffic
is
from the ISP we're talking to and this is the reason we deployed the
caching box on this ISP edge.
34011bc56457235a2caa5ed1d4a29f3c?d=identicon&s=25 Jonathan Matthews (Guest)
on 2014-06-18 22:06
(Received via mailing list)
On 18 Jun 2014 20:45, "shahzaib shahzaib" <shahzaib.cb@gmail.com> wrote:
>
> >>why not host those file on a professional CDN instead of in-house?
> Because 80% of the traffic is from our country and 50% of that traffic is
from the ISP we're talking to and this is the reason we deployed the
caching box on this ISP edge.

But, as this now pretty off-topic thread is repeatedly demonstrating,
you
haven't deployed diddly squat. You've just chucked a server in a rack
and
are having to rely on unpaid, debugging-by-email advice from an
pseudonymous mailing list to get it even near functional. Let alone
properly defined and understood.

If your *business* needs to do this, pay a professional person or
organisation to help you like others have suggested. The alternative,
which
you appear to be ending up with, is a black box of hacks known only to
yourself and potentially understood by no-one, which will SPoF on you,
personally, until you leave that organisation. You don't want that.
Trust
me.
</sysadmin>

Just my 2 cents,
Jonathan
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-06-19 07:21
(Received via mailing list)
@Jonathon, yes you're right i should not post off-topic here, offcourse
i
thought as nginx has tremendous amount of capabilities and there might
be
alternative possibility of BGP too but i was wrong. I would be thankful
if
you help me on ngx-http_geo_module as it is related to nginx and help me
with the following problem :-

---------------------------------------------------------------------------------------------------------------------
Our local ISP provided us with some testing ip prefixes to check nginx
based caching.  i.e
geo {
default 0;
10.0.0.0/8 1;
39.23.2.0/24 1;
112.50.192.0/18 1;
}

Now whenever we add the prefix 112.50.192.0/18 in geo {} , all the
requests
coming from the 39.23.2.0/24 and 10.0.0.0/8 returns nginx 504 gateway
error
and videos failed to stream. To resolve this issue, we have to remove
112.50.192.0/18 1; from geo block.



On Thu, Jun 19, 2014 at 1:05 AM, Jonathan Matthews
<contact@jpluscplusm.com>
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.