Comparison of varnish and squid

Source: Internet
Author: User
Tags varnish

Comparison between varnish and squid    speaking of varnish, it is not necessary to mention Squid,squid is a high-performance proxy cache server, it and varnish have a lot of similarities and differences, here the analysis is as follows:   Here's the same point between them.:   (1) is a reverse proxy server.    (2) are open source software.    The following are their differences, but also the advantages of varnish:   (1) Varnish stability is very high, both in the completion of the same load of work, squid server failure probability is higher than varnish, Because using squid often restarts.    (2) varnish access faster, varnish with “ visual page cache” technology, all cached data is read directly from memory, and squid is read from the hard disk, so varnish is faster in terms of access speed.    (3) varnish can support more concurrent connections because the varnish TCP connection is released faster than squid. Thus, more TCP connections can be supported in high concurrent connections.    (4) varnish can use regular expressions to clear part of the cache in batches using a management port, and squid is not available.    (5)  squid belongs to a single process using a single-core CPU, but the varnish is processed by opening multiple processes in fork form, so it is reasonable to use all cores to process the corresponding request.    of course, compared with the traditional squid, varnish also has shortcomings, listed as follows:   1)  varnish process once hang, crash, or reboot, the cached data is completely freed from memory, At this point all requests are sent to the back-end server, which can put a lot of pressure on the backend server in high concurrency.   2)   in varnish if a request for a single URL is requested by HA/F5 (load balancer) each time the request is in a different varnish server, the requested varnish server will be penetrated to the backend, And the same request will be cached on multiple servers, which will also result in a waste of varnish cache resources, as well as performance degradation.     Solution:   1)   In the case of a large number of visitsIt is recommended to start with Varnish's memory cache and need to be followed by more than one squid server. Mainly in order to prevent the front of the varnish service, the server is restarted, there will certainly be a lot of penetration so that squid can serve as a second cache, but also make up for the varnish cache in memory restart will release the issue.   2)   This problem can be resolved by making a URL hash on the load balancer, allowing a single URL request to be pinned to a varnish server.    Note: The above solution also requires a thorough test, not proven

Comparison of varnish and squid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.