You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

LVS and Varnish: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Krinkle
No edit summary
imported>Krinkle
No edit summary
Line 1: Line 1:
{{Navigation Wikimedia infrastructure|expand=caching}}
{{Navigation Wikimedia infrastructure|expand=caching}}
== LVS and Varnish infrastructure ==
== LVS and Varnish infrastructure ==
[[File:WMF Inbound Text Traffic.png|Diagram of "text" traffic flow through Wikimedia front edge LVS/nginx/Varnish infrastructure.]]
[[File:WMF Inbound Text Traffic Diagram.svg|850px|Diagram of "text" traffic flow through Wikimedia front edge LVS/nginx/Varnish infrastructure.]]


=== Notes ===
=== Notes ===
esams is representative of all cache-only sites; ulsfo is similar.
[[esams]] is representative of all cache-only sites; [[ulsfo]] is similar.


"upload" and "mobile" traffic operate similarly to "text" shown here.
"[[upload.wikimedia.org|upload]]" and "mobile" traffic operate similarly to "text" shown here.


"bits" does not; it lacks the bottom :3128 layer of varnish.  The :80 layer jumps directly down to the appservers in the primary datacenter, and the cross-datacenter traffic is also between the :80 instances in this case.
When [[LVS]] balances traffic to the :80 [[varnish]]es directly for HTTP, it choses randomlyFor :443 to the nginxes, it uses a hash of the client IP to help with SSL session persistence.


When LVS balances traffic to the :80 varnishes directly for HTTP, it choses randomly.  For :443 to the nginxes, it uses a hash of the client IP to help with SSL session persistence.
Within the caching layer (cp[1234]xxx machines), the jump from [[nginx]] to varnish:80 is direct on the local host only.
 
Within the caching layer (cp*/amssq* machines), the jump from nginx to varnish:80 is direct on the local host only.


However, the jump from varnish:80 (frontend) to varnish:3128 (backend) is different: for that jump, we hash on the URL (etc) when balancing to the backends to divide the cache space among all machines, and thus the request typically moves from one machine to another within the cache layer here.
However, the jump from varnish:80 (frontend) to varnish:3128 (backend) is different: for that jump, we hash on the URL (etc) when balancing to the backends to divide the cache space among all machines, and thus the request typically moves from one machine to another within the cache layer here.


[[Category:Caching]]
[[Category:Caching]]

Revision as of 16:32, 5 December 2015

LVS and Varnish infrastructure

Diagram of "text" traffic flow through Wikimedia front edge LVS/nginx/Varnish infrastructure.

Notes

esams is representative of all cache-only sites; ulsfo is similar.

"upload" and "mobile" traffic operate similarly to "text" shown here.

When LVS balances traffic to the :80 varnishes directly for HTTP, it choses randomly. For :443 to the nginxes, it uses a hash of the client IP to help with SSL session persistence.

Within the caching layer (cp[1234]xxx machines), the jump from nginx to varnish:80 is direct on the local host only.

However, the jump from varnish:80 (frontend) to varnish:3128 (backend) is different: for that jump, we hash on the URL (etc) when balancing to the backends to divide the cache space among all machines, and thus the request typically moves from one machine to another within the cache layer here.