ELB ---> Nginx servers ---> one Varnish Server ---> Return if cache is found. The problem I met is that /pop_service/{channel_id}/points will get burst hit by users. Thus, the load of the server will increase dramatically. The solution to this problem is that ELB(Amazon Load Balancing Server) send matched requests to Nginx servers. upstream backend { hash $request_uri consistent; server 104.207.149.81; server 45.63.83.59; } server { listen 80 default_server; listen [::]:80 default_server; location / { proxy_pass http://backend; } } Nginx servers with the above configuration have the ability to route requests based on request URI. AKA, the same URI gets redirects to the same server. The config file of varnish is the following: vcl 4.0; import directors; backend server1 { .host = "104.207.149.81"; .port = "80"; .probe = { .url = "/"; .timeout = 1s
Comments
Post a Comment