The document describes configuration settings for an Apache web server, PHP, MySQL, and performance testing using ApacheBench. It then evaluates adding features like query caching, persistent MySQL connections, and using Varnish as a reverse proxy cache. Test results show that each of these optimizations improves the server's request handling performance, with Varnish providing the largest gains.
VCL template abstraction model and automated deployments to FastlyFastly
Neeraj Mendiratta Sr. Director of Devops, A+E Networks at Fastly Altitude 2016
Hosting hundreds of websites and backend services for multiple environments at the Content Delivery Network level presented a challenge for us at A+E. We solved this problem by applying the DevOps concept of “Infrastructure as Code”. First, a VCL templating framework was created to support a multitude of services and environment agnostic configurations. Then we integrated our CI tool with GitHub and Fastly to make a scalable way of managing our many services. This walkthrough is based on our real-world experiences. We discuss: using the template framework; how to handle the workflow between development, QA, and production environments; and the API calls and integrations necessary for automating deployments to Fastly.
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...Docker, Inc.
The Prometheus monitoring system collects and stores time series data to give valuable insights over hosts, containers, and applications. Its storage engine was designed to be multiple orders of magnitude faster and more space efficient than, say, RRD or SQL storage. However, with the rise of orchestration systems such as Docker Swarm and Kubernetes, and their extensive use of techniques like rolling updates and auto-scaling, environments are becoming increasingly dynamic. This increases the strain on metrics collection systems. To deal with the challenges, a new storage engine has been developed from scratch, bringing a sharp increase in performance and enabling new features.
This talk will describe this new storage engine, its architecture, its data structures, and explain why and how it is well suited to gracefully handle high turnover rates of monitoring targets and provide consistent query performance.
Paolo Alvarado Customer Support Engineer, Fastly at Altitude 2016
Customer Support Engineer Paolo Alvarado discusses various useful features of advanced Varnish Configuration Language (VCL).
Scalable Architecture Design
DEVIEW 2013 에서 발표한 "오픈소스를 활용한 분산 아키텍처 구현기술" 장표입니다.
Scalable Architecture 디자인을 위해 필요한 다양한 구현 기술 중 몇가지를 소개해 드립니다.
관련된 내용으로 문의 있으시면 메일로 연락 주세요~
VCL template abstraction model and automated deployments to FastlyFastly
Neeraj Mendiratta Sr. Director of Devops, A+E Networks at Fastly Altitude 2016
Hosting hundreds of websites and backend services for multiple environments at the Content Delivery Network level presented a challenge for us at A+E. We solved this problem by applying the DevOps concept of “Infrastructure as Code”. First, a VCL templating framework was created to support a multitude of services and environment agnostic configurations. Then we integrated our CI tool with GitHub and Fastly to make a scalable way of managing our many services. This walkthrough is based on our real-world experiences. We discuss: using the template framework; how to handle the workflow between development, QA, and production environments; and the API calls and integrations necessary for automating deployments to Fastly.
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...Docker, Inc.
The Prometheus monitoring system collects and stores time series data to give valuable insights over hosts, containers, and applications. Its storage engine was designed to be multiple orders of magnitude faster and more space efficient than, say, RRD or SQL storage. However, with the rise of orchestration systems such as Docker Swarm and Kubernetes, and their extensive use of techniques like rolling updates and auto-scaling, environments are becoming increasingly dynamic. This increases the strain on metrics collection systems. To deal with the challenges, a new storage engine has been developed from scratch, bringing a sharp increase in performance and enabling new features.
This talk will describe this new storage engine, its architecture, its data structures, and explain why and how it is well suited to gracefully handle high turnover rates of monitoring targets and provide consistent query performance.
Paolo Alvarado Customer Support Engineer, Fastly at Altitude 2016
Customer Support Engineer Paolo Alvarado discusses various useful features of advanced Varnish Configuration Language (VCL).
Scalable Architecture Design
DEVIEW 2013 에서 발표한 "오픈소스를 활용한 분산 아키텍처 구현기술" 장표입니다.
Scalable Architecture 디자인을 위해 필요한 다양한 구현 기술 중 몇가지를 소개해 드립니다.
관련된 내용으로 문의 있으시면 메일로 연락 주세요~
When it comes to caching, there are two types of web developers - those with phat stacks of cache money and those suffering from cache anxiety. Caching is particularly handy when scaling Rails apps, however we often avoid putting in effort because it can quickly get complicated without effective strategies. Rails provides a host of built-in caching interfaces that are easy to leverage and extend. I’ll talk about how to do this and combine rails with technologies like CDNs and HTTP accelerators like Varnish so that you can more effectively cache everything, everywhere without fear of serving stale content.
Michael May is an API Engineer at Fastly and a former Austinite, now hailing from San Francisco. While in Texas he studied at UT Austin and co-founded CDN Sumo, which was acquired by Fastly. He’s waiting for the day when FaaS (Franklin BBQ as a Service) becomes a thing and dreams about fast websites.
2016년 12월에 진행되었던 W3C HTML5 Conference 2016의 오후 트렉 (웹프레임워크)의 발표 자료입니다.
GDG Korea Web Tech 운영진이신 한장현 님께서 ‘AngularJS와 ES6’에 대한 주제로 발표를 진행하였습니다. 이 발표를 통해서 Angular와ES6를 함께 사용하기 위해 필요한 구체적인 내용들을 공유하였습니다. Angular를 현재 사용하시는 분들께 많은 도움이 되는 시간이었던 것 같습니다.
Slides for presentation on ZooKeeper I gave at Near Infinity (www.nearinfinity.com) 2012 spring conference.
The associated sample code is on GitHub at https://github.com/sleberknight/zookeeper-samples
Desenvolver uma aplicação que precisa de comunicar com a rede não precisa ser complicado. Neste webinar será mostrado como o Qt torna programação para rede muito mais simples. Será dado um rápido overview de como criar sockets UDP e TCP, broadcast e multicast além de fazer requisições REST usando somente a API do QtNetwork.
Мастер-класс "Логическая репликация и Avito" / Константин Евтеев, Михаил Тюр...Ontico
HighLoad++ 2017
Зал «Кейптаун», 7 ноября, 12:00
Тезисы:
http://www.highload.ru/2017/abstracts/2868.html
В Avito объявления хранятся в базах данных Postgres. При этом уже на протяжении многих лет активно применяется логическая репликация. С помощью неё успешно решаются вопросы роста объема данных и количества запросов к ним, масштабирования и распределения нагрузки, доставки данных в DWH и поисковые подсистемы, меж-базные и меж-сервисные синхронизации данных и пр.
...
When it comes to caching, there are two types of web developers - those with phat stacks of cache money and those suffering from cache anxiety. Caching is particularly handy when scaling Rails apps, however we often avoid putting in effort because it can quickly get complicated without effective strategies. Rails provides a host of built-in caching interfaces that are easy to leverage and extend. I’ll talk about how to do this and combine rails with technologies like CDNs and HTTP accelerators like Varnish so that you can more effectively cache everything, everywhere without fear of serving stale content.
Michael May is an API Engineer at Fastly and a former Austinite, now hailing from San Francisco. While in Texas he studied at UT Austin and co-founded CDN Sumo, which was acquired by Fastly. He’s waiting for the day when FaaS (Franklin BBQ as a Service) becomes a thing and dreams about fast websites.
2016년 12월에 진행되었던 W3C HTML5 Conference 2016의 오후 트렉 (웹프레임워크)의 발표 자료입니다.
GDG Korea Web Tech 운영진이신 한장현 님께서 ‘AngularJS와 ES6’에 대한 주제로 발표를 진행하였습니다. 이 발표를 통해서 Angular와ES6를 함께 사용하기 위해 필요한 구체적인 내용들을 공유하였습니다. Angular를 현재 사용하시는 분들께 많은 도움이 되는 시간이었던 것 같습니다.
Slides for presentation on ZooKeeper I gave at Near Infinity (www.nearinfinity.com) 2012 spring conference.
The associated sample code is on GitHub at https://github.com/sleberknight/zookeeper-samples
Desenvolver uma aplicação que precisa de comunicar com a rede não precisa ser complicado. Neste webinar será mostrado como o Qt torna programação para rede muito mais simples. Será dado um rápido overview de como criar sockets UDP e TCP, broadcast e multicast além de fazer requisições REST usando somente a API do QtNetwork.
Мастер-класс "Логическая репликация и Avito" / Константин Евтеев, Михаил Тюр...Ontico
HighLoad++ 2017
Зал «Кейптаун», 7 ноября, 12:00
Тезисы:
http://www.highload.ru/2017/abstracts/2868.html
В Avito объявления хранятся в базах данных Postgres. При этом уже на протяжении многих лет активно применяется логическая репликация. С помощью неё успешно решаются вопросы роста объема данных и количества запросов к ним, масштабирования и распределения нагрузки, доставки данных в DWH и поисковые подсистемы, меж-базные и меж-сервисные синхронизации данных и пр.
...
Learn from Fastly veteran Cassandra Dixon on some of the most common customer issues we see — such as why things aren’t caching, misconfigured origins, issues with intermediary proxies, and VCL snafus — and the best ways to resolve them. We’ll also discuss our unique approach to debugging — using seemingly mundane tools to diagnose issues in creative ways — and how you can apply these methods to your own organization to get the most out of Fastly’s offerings.
Salesforce at Stacki Atlanta Meetup February 2016StackIQ
Dave Peterson's presentation on how Salesforce uses Stacki and Chef to provision and manage thousands of servers. Stacki Atlanta kickoff Meetup on 2/23/16 at the Microsoft Innovation Center. Dave is a Lead Systems Engineer at Salesforce.
Andrew Betts Web Developer, The Financial Times at Fastly Altitude 2016
Running custom code at the Edge using a standard language is one of the biggest advantages of working with Fastly’s CDN. Andrew gives you a tour of all the problems the Financial Times and Nikkei solve in VCL and how their solutions work.
Altitude San Francisco 2018: Programming the EdgeFastly
Programming the edge
Second floor
Andrew Betts
Principal Developer Advocate, Fastly
Hide abstract
Through our support for running your own code on our edge servers, Fastly's network offers you a platform of unparalleled speed, reliability and efficiency to which you can delegate a surprising amount of logic that has traditionally been in the application layer. In this workshop, you'll implement a series of advanced edge solutions, and learn how to apply these patterns to your own applications to reduce your origin load, dramatically improve performance, and make your applications more secure.
(SDD402) Amazon ElastiCache Deep Dive | AWS re:Invent 2014Amazon Web Services
Peek behind the scenes to learn about Amazon ElastiCache's design and architecture. See common design patterns of our Memcached and Redis offerings and how customers have used them for in-memory operations and achieved improved latency and throughput for applications. During this session, we review best practices, design patterns, and anti-patterns related to Amazon ElastiCache.
Caching and tuning fun for high scalabilityWim Godden
Caching has been a 'hot' topic for a few years. But caching takes more than merely taking data and putting it in a cache : the right caching techniques can improve performance and reduce load significantly. But we'll also look at some major pitfalls, showing that caching the wrong way can bring down your site. If you're looking for a clear explanation about various caching techniques and tools like Memcached, Nginx and Varnish, as well as ways to deploy them in an efficient way, this talk is for you.
Ähnlich wie Varnish presentation for the Symfony Zaragoza user group (20)
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
AI Genie Review: World’s First Open AI WordPress Website CreatorGoogle
AI Genie Review: World’s First Open AI WordPress Website Creator
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-genie-review
AI Genie Review: Key Features
✅Creates Limitless Real-Time Unique Content, auto-publishing Posts, Pages & Images directly from Chat GPT & Open AI on WordPress in any Niche
✅First & Only Google Bard Approved Software That Publishes 100% Original, SEO Friendly Content using Open AI
✅Publish Automated Posts and Pages using AI Genie directly on Your website
✅50 DFY Websites Included Without Adding Any Images, Content Or Doing Anything Yourself
✅Integrated Chat GPT Bot gives Instant Answers on Your Website to Visitors
✅Just Enter the title, and your Content for Pages and Posts will be ready on your website
✅Automatically insert visually appealing images into posts based on keywords and titles.
✅Choose the temperature of the content and control its randomness.
✅Control the length of the content to be generated.
✅Never Worry About Paying Huge Money Monthly To Top Content Creation Platforms
✅100% Easy-to-Use, Newbie-Friendly Technology
✅30-Days Money-Back Guarantee
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIGenieApp #AIGenieBonus #AIGenieBonuses #AIGenieDemo #AIGenieDownload #AIGenieLegit #AIGenieLiveDemo #AIGenieOTO #AIGeniePreview #AIGenieReview #AIGenieReviewandBonus #AIGenieScamorLegit #AIGenieSoftware #AIGenieUpgrades #AIGenieUpsells #HowDoesAlGenie #HowtoBuyAIGenie #HowtoMakeMoneywithAIGenie #MakeMoneyOnline #MakeMoneywithAIGenie
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Varnish presentation for the Symfony Zaragoza user group
1. r.v. var·nished, var·nish·ing, var·nish·es
1. To cover with varnish.
2. To give a smooth and glossy finish to.
3. To give a deceptively attractive appearance to; gloss over.
by jnerin 1
2. Server (cubietruck)
● AllWinnerTech SOC
A20
○ ARM® Cortex™-A7
Dual-Core
● 2GB ram
● SAMSUNG SpinPoint
F2 EG 1.5TB sata
hard disk
● 1Gb Ethernet
2
16. 1 vcl 4.0;
2 # Based on: https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/
blob/master/default.vcl
3 # Corrected & improved for 4.0.2 by jnerin@gmail.com
4 import std;
5 import directors;
6 backend server1 { # Define one backend
7 .host = "127.0.0.1"; # IP or Hostname of backend
8 .port = "80"; # Port Apache or whatever is listening
9 .max_connections = 300; # That's it
10 .probe = {
11 #.url = "/"; # short easy way (GET /)
12 # We prefer to only do a HEAD /
13 .request =
14 "HEAD / HTTP/1.1"
15 "Host: localhost"
16 "Connection: close";
17 .interval = 5s; # check the health of each backend every 5 seconds
18 .timeout = 1s; # timing out after 1 second.
19 # If 3 out of the last 5 polls succeeded the backend is considered healthy,
otherwise it will be marked as sick
20 .window = 5;
21 .threshold = 3;
22 }
23 .first_byte_timeout = 300s; # How long to wait before we receive a first byte from
our backend?
24 .connect_timeout = 5s; # How long to wait for a backend connection?
25 .between_bytes_timeout = 2s; # How long to wait between bytes received from our
backend?
26 }
27 acl purge {
28 # ACL we'll use later to allow purges
29 "localhost";
30 "127.0.0.1";
31 "::1";
32 }
16
17. 34 /*
35 acl editors {
36 # ACL to honor the "Cache-Control: no-cache" header to force a refresh but only from selected IPs
37 "localhost";
38 "127.0.0.1";
39 "::1";
40 }
41 */
42
43 sub vcl_init {
44 # Called when VCL is loaded, before any requests pass through it. Typically used to initialize
VMODs.
45
46 new vdir = directors.round_robin();
47 vdir.add_backend(server1);
48 # vdir.add_backend(server...);
49 # vdir.add_backend(servern);
50 }
51
52 sub vcl_recv {
53 # Called at the beginning of a request, after the complete request has been received and parsed.
Its purpose is to decide whether or not to serve the request, how to do it, and, if applicable, which
backend to use.
54 # also used to modify the request
55
56 set req.backend_hint = vdir.backend(); # send all traffic to the vdir director
57
58 if (req.restarts == 0) {
59 if (req.http.X-Forwarded-For) { # set or append the client.ip to X-Forwarded-For
header
60 set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip;
61 } else {
62 set req.http.X-Forwarded-For = client.ip;
63 }
64 } 17
18. 66 # Normalize the header, remove the port (in case you're testing this on various TCP ports)
67 set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");
68
69 # Normalize the query arguments
70 set req.url = std.querysort(req.url);
71
72 # Allow purging
73 if (req.method == "PURGE") {
74 if (!client.ip ~ purge) { # purge is the ACL defined at the begining
75 # Not from an allowed IP? Then die with an error.
76 return (synth(405, "This IP is not allowed to send PURGE requests."));
77 }
78 # If you got this stage (and didn't error out above), purge the cached result
79 return (purge);
80 }
81
82 # Only deal with "normal" types
83 if (req.method != "GET" &&
84 req.method != "HEAD" &&
85 req.method != "PUT" &&
86 req.method != "POST" &&
87 req.method != "TRACE" &&
88 req.method != "OPTIONS" &&
89 req.method != "PATCH" &&
90 req.method != "DELETE") {
91 /* Non-RFC2616 or CONNECT which is weird. */
92 return (pipe);
93 }
94
95 # Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-
websockets.html)
96 if (req.http.Upgrade ~ "(?i)websocket") {
97 return (pipe);
98 }
18
19. Effect of set req.url = std.querysort(req.url);
$ GET -de "http://test:8080/varnish.vcl.html?q1=1&q2=2&q3=3" |egrep
"(Cache|Age|ETag|Expires|Date)"
Cache-Control: max-age=14400
Date: Wed, 08 Oct 2014 14:25:28 GMT
Age: 984
ETag: W/"3d838b6-b4f1-504e9efa40148"
Expires: Wed, 08 Oct 2014 18:25:28 GMT
Client-Date: Wed, 08 Oct 2014 14:41:53 GMT
X-Cache: HIT
X-Cache-Hits: 5
$ GET -de "http://test:8080/varnish.vcl.html?q2=2&q1=1&q3=3" |egrep
"(Cache|Age|ETag|Expires|Date)"
Cache-Control: max-age=14400
Date: Wed, 08 Oct 2014 14:25:28 GMT
Age: 994
ETag: W/"3d838b6-b4f1-504e9efa40148"
Expires: Wed, 08 Oct 2014 18:25:28 GMT
Client-Date: Wed, 08 Oct 2014 14:42:02 GMT
X-Cache: HIT
X-Cache-Hits: 6
19
20. 100 # Only cache GET or HEAD requests. This makes sure the POST requests are always passed.
101 if (req.method != "GET" && req.method != "HEAD") {
102 return (pass);
103 }
104
105 # Some generic URL manipulation, useful for all templates that follow
106 # First remove the Google Analytics added parameters, useless for our backend
107 if (req.url ~ "(?|&)
(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=") {
108 set req.url = regsuball(req.url, "&
(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_-.%25]+)", "");
109 set req.url = regsuball(req.url, "?
(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_-.%25]+)", "?");
110 set req.url = regsub(req.url, "?&", "?");
111 set req.url = regsub(req.url, "?$", "");
112 }
113
114 # Strip hash, server doesn't need it.
115 if (req.url ~ "#") {
116 set req.url = regsub(req.url, "#.*$", "");
117 }
118
119 # Strip a trailing ? if it exists
120 if (req.url ~ "?$") {
121 set req.url = regsub(req.url, "?$", "");
122 }
20
21. 124 # Some generic cookie manipulation, useful for all templates that follow
125 # Remove the "has_js" cookie
126 set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", "");
127
128 # Remove any Google Analytics based cookies
129 set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");
130 set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", "");
131 set req.http.Cookie = regsuball(req.http.Cookie, "utmctr=[^;]+(; )?", "");
132 set req.http.Cookie = regsuball(req.http.Cookie, "utmcmd.=[^;]+(; )?", "");
133 set req.http.Cookie = regsuball(req.http.Cookie, "utmccn.=[^;]+(; )?", "");
134
135 # Remove the Quant Capital cookies (added by some plugin, all __qca)
136 set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", "");
137
138 # Remove the AddThis cookies
139 set req.http.Cookie = regsuball(req.http.Cookie, "__atuvc=[^;]+(; )?", "");
140
141 # Remove a ";" prefix in the cookie if present
142 set req.http.Cookie = regsuball(req.http.Cookie, "^;s*", "");
143
144 # Are there cookies left with only spaces or that are empty?
145 if (req.http.cookie ~ "^s*$") {
146 unset req.http.cookie;
147 }
21
22. 149 # Normalize Accept-Encoding header
150 # straight from the manual: https://www.varnish-cache.org/docs/3.0/tutorial/vary.html
151 # TODO: Test if it's still needed, Varnish 4 now does this by itself if http_gzip_support =
on
152 # https://www.varnish-cache.org/docs/trunk/users-guide/compression.html
153 # https://www.varnish-cache.org/docs/trunk/phk/gzip.html
154 if (req.http.Accept-Encoding) {
155 if (req.url ~ ".(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
156 # No point in compressing these
157 unset req.http.Accept-Encoding;
158 } elsif (req.http.Accept-Encoding ~ "gzip") {
159 set req.http.Accept-Encoding = "gzip";
160 } elsif (req.http.Accept-Encoding ~ "deflate") {
161 set req.http.Accept-Encoding = "deflate";
162 } else {
163 # unkown algorithm
164 unset req.http.Accept-Encoding;
165 }
166 }
167
168 if (req.http.Cache-Control ~ "(?i)no-cache") {
169 #if (req.http.Cache-Control ~ "(?i)no-cache" && client.ip ~ editors) { # create the acl
editors if you want to restrict the Ctrl-F5
170 # http://varnish.projects.linpro.no/wiki/VCLExampleEnableForceRefresh
171 # Ignore requests via proxy caches and badly behaved crawlers
172 # like msnbot that send no-cache with every request.
173 if (! (req.http.Via || req.http.User-Agent ~ "(?i)bot" || req.http.X-Purge)) {
174 #set req.hash_always_miss = true; # Doesn't seems to refresh the object in
the cache
175 return(purge); # Couple this with restart in vcl_purge and X-Purge header
to avoid loops
176 }
177 }
22
23. 179 # Large static files are delivered directly to the end-user without
180 # waiting for Varnish to fully read the file first.
181 # Varnish 4 fully supports Streaming, so set do_stream in vcl_backend_response()
182 if (req.url ~ "^[^?]*.(mp[34]|rar|tar|tgz|gz|wav|zip|bz2|xz|7z|avi|mov|ogm|mpe?g|mk[av])
(?.*)?$") {
183 unset req.http.Cookie;
184 return (hash);
185 }
186
187 # Remove all cookies for static files
188 # A valid discussion could be held on this line: do you really need to cache static files
that don't cause load? Only if you have memory left.
189 # Sure, there's disk I/O, but chances are your OS will already have these files in their
buffers (thus memory).
190 # Before you blindly enable this, have a read here: http://mattiasgeniar.
be/2012/11/28/stop-caching-static-files/
191 if (req.url ~ "^[^?]*.
(bmp|bz2|css|doc|eot|flv|gif|gz|ico|jpeg|jpg|js|less|pdf|png|rtf|swf|txt|woff|xml)(?.*)?$") {
192 unset req.http.Cookie;
193 return (hash);
194 }
195
196 # Send Surrogate-Capability headers to announce ESI support to backend
197 set req.http.Surrogate-Capability = "key=ESI/1.0";
198
199 if (req.http.Authorization) {
200 # Not cacheable by default
201 return (pass);
202 }
203
204 return (hash);
205 }
23
24. 207 sub vcl_pipe {
208 # Called upon entering pipe mode. In this mode, the request is passed on to the backend, and any
further data from both the client and backend is passed on unaltered until either end closes the
connection. Basically, Varnish will degrade into a simple TCP proxy, shuffling bytes back and forth.
For a connection in pipe mode, no other VCL subroutine will ever get called after vcl_pipe.
209
210 # Note that only the first request to the backend will have
211 # X-Forwarded-For set. If you use X-Forwarded-For and want to
212 # have it set for all requests, make sure to have:
213 # set bereq.http.connection = "close";
214 # here. It is not set by default as it might break some broken web
215 # applications, like IIS with NTLM authentication.
216
217 #set bereq.http.Connection = "Close";
218
219 # Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-
websockets.html)
220 if (req.http.upgrade) {
221 set bereq.http.upgrade = req.http.upgrade;
222 }
223
224 return (pipe);
225 }
226
227 sub vcl_pass {
228 # Called upon entering pass mode. In this mode, the request is passed on to the backend, and the
backend's response is passed on to the client, but is not entered into the cache. Subsequent requests
submitted over the same client connection are handled normally.
229
230 # return (pass);
231 }
24
25. 233 # The data on which the hashing will take place
234 sub vcl_hash {
235 # Called after vcl_recv to create a hash value for the request. This is used as a key to look up
the object in Varnish.
236
237 hash_data(req.url);
238
239 if (req.http.host) {
240 hash_data(req.http.host);
241 } else {
242 hash_data(server.ip);
243 }
244
245 # hash cookies for requests that have them
246 if (req.http.Cookie) {
247 hash_data(req.http.Cookie);
248 }
249 }
250
251 sub vcl_hit {
252 # Called when a cache lookup is successful.
253
254 if (obj.ttl >= 0s) {
255 # A pure unadultered hit, deliver it
256 return (deliver);
257 }
25
26. 259 # https://www.varnish-cache.org/docs/trunk/users-guide/vcl-grace.html
260 # When several clients are requesting the same page Varnish will send one request to the
backend and place the others on hold while fetching one copy from the backend. In some products this
is called request coalescing and Varnish does this automatically.
261 # If you are serving thousands of hits per second the queue of waiting requests can get
huge. There are two potential problems - one is a thundering herd problem - suddenly releasing a
thousand threads to serve content might send the load sky high. Secondly - nobody likes to wait. To
deal with this we can instruct Varnish to keep the objects in cache beyond their TTL and to serve the
waiting requests somewhat stale content.
262
269 # We have no fresh fish. Lets look at the stale ones.
270 if (std.healthy(req.backend_hint)) {
271 # Backend is healthy. Limit age to 10s.
272 if (obj.ttl + 10s > 0s) {
273 #set req.http.grace = "normal(limited)";
274 return (deliver);
275 } else {
276 # No candidate for grace. Fetch a fresh object.
277 return(fetch);
278 }
279 } else {
280 # backend is sick - use full grace
281 if (obj.ttl + obj.grace > 0s) {
282 #set req.http.grace = "full";
283 return (deliver);
284 } else {
285 # no graced object.
286 return (fetch);
287 }
288 }
289
290
291 # fetch & deliver once we get the result
292 return (fetch); # Dead code, keep as a safeguard
293 } 26
27. 295 sub vcl_miss {
296 # Called after a cache lookup if the requested document was not found in the cache. Its purpose is
to decide whether or not to attempt to retrieve the document from the backend, and which backend to
use.
297
298 return (fetch);
299 }
300
301 # Handle the HTTP request coming from our backend
302 sub vcl_backend_response {
303 # Called after the response headers has been successfully retrieved from the backend.
304
305 # Pause ESI request and remove Surrogate-Control header
306 if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
307 unset beresp.http.Surrogate-Control;
308 set beresp.do_esi = true;
309 }
310
311 # Enable cache for all static files
312 # The same argument as the static caches from above: monitor your cache size, if you get
data nuked out of it, consider giving up the static file cache.
313 # Before you blindly enable this, have a read here: http://mattiasgeniar.
be/2012/11/28/stop-caching-static-files/
314 if (bereq.url ~ "^[^?]*.(bmp|bz2|css|doc|eot|flv|gif|gz|ico|jpeg|jpg|js|less|mp[34]
|pdf|png|rar|rtf|swf|tar|tgz|txt|wav|woff|xml|zip)(?.*)?$") {
315 unset beresp.http.set-cookie;
316 }
27
28. 319 # Large static files are delivered directly to the end-user without
320 # waiting for Varnish to fully read the file first.
321 # Varnish 4 fully supports Streaming, so use streaming here to avoid locking.
322 if (bereq.url ~ "^[^?]*.(mp[34]|rar|tar|tgz|gz|wav|zip|bz2|xz|7z|avi|mov|ogm|mpe?g|mk[av])
(?.*)?$") {
323 unset beresp.http.set-cookie;
324 set beresp.do_stream = true; # Check memory usage it'll grow in fetch_chunksize
blocks (128k by default) if
325 # the backend doesn't send a Content-Length header,
so only enable it for big objects
326 set beresp.do_gzip = false; # Don't try to compress it for storage
327 }
329 # Sometimes, a 301 or 302 redirect formed via Apache's mod_rewrite can mess with the HTTP
port that is being passed along.
330 # This often happens with simple rewrite rules in a scenario where Varnish runs on :80 and
Apache on :8080 on the same box.
331 # A redirect can then often redirect the end-user to a URL on :8080, where it should be :
80.
332 # This may need finetuning on your setup.
333 #
334 # To prevent accidental replace, we only filter the 301/302 redirects for now.
335 if (beresp.status == 301 || beresp.status == 302) {
336 set beresp.http.Location = regsub(beresp.http.Location, ":[0-9]+", "");
337 }
339 # Disable queue coalescence for uncacheable objects
340 if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") {
341 set beresp.uncacheable = true; # hit_for_pass
342 set beresp.ttl = 120s; # Remeber this
343 return (deliver);
344 }
346 # Allow stale content, in case the backend goes down.
347 # make Varnish keep all objects for 6 hours beyond their TTL
348 set beresp.grace = 6h;
350 return (deliver);
351 } 28
29. 353 # The routine when we deliver the HTTP request to the user
354 # Last chance to modify headers that are sent to the client
355 sub vcl_deliver {
356 # Called before a cached object is delivered to the client.
357
358 if (obj.hits > 0) { # Add debug header to see if it's a HIT/MISS and the number of hits,
disable when not needed
359 set resp.http.X-Cache = "HIT";
360 } else {
361 set resp.http.X-Cache = "MISS";
362 }
363 # Please note that obj.hits behaviour changed in 4.0, now it counts per objecthead, not per
object
364 # and obj.hits may not be reset in some cases where bans are in use. See bug 1492 for
details.
365 # So take hits with a grain of salt
366 set resp.http.X-Cache-Hits = obj.hits;
368 # Remove some headers: PHP version
369 unset resp.http.X-Powered-By;
371 # Remove some headers: Apache version & OS
372 unset resp.http.Server;
373 unset resp.http.X-Drupal-Cache;
374 unset resp.http.X-Varnish;
375 unset resp.http.Via;
376 unset resp.http.Link;
378 return (deliver);
379 }
380
381 sub vcl_purge {
382 # restart request
383 set req.http.X-Purge = "Yes";
384 return(restart);
385 }
29
30. 387 sub vcl_synth {
388 if (resp.status == 720) {
389 # We use this special error status 720 to force redirects with 301 (permanent)
redirects
390 # To use this, call the following from anywhere in vcl_recv: error 720 "http:
//host/new.html"
391 set resp.http.Location = resp.reason;
392 set resp.status = 301;
393 return (deliver);
394 } elseif (resp.status == 721) {
395 # And we use error status 721 to force redirects with a 302 (temporary) redirect
396 # To use this, call the following from anywhere in vcl_recv: error 720 "http:
//host/new.html"
397 set resp.http.Location = resp.reason;
398 set resp.status = 302;
399 return (deliver);
400 }
401
402 return (deliver);
403 }
404
405
406 sub vcl_fini {
407 # Called when VCL is discarded only after all requests have exited the VCL. Typically used to
clean up VMODs.
408
409 return (ok);
410 }
30
31. sub vcl_recv {
if (req.url ~ "^/varnish/") {
# Lame example to generate content, look down in vcl_synth for status 820
return (synth(820, "Test"));
}
}
sub vcl_synth {
if (resp.status == 820) {
# Lame example showing how to generate synthetic content.
# Usually to do this you would use a vmod from https://www.varnish-cache.org/vmods
# to do things like memcache/redis/database/... lookups and return meaningful things
# expected url /varnish/parameter1/min/max/ -> /varnish/real_random_api/8/32/
set resp.http.Content-Type = "text/plain; charset=utf-8";
set req.http.X-parameter1 = regsub(req.url, "^/varnish/(.*?)/.*", "1");
set req.http.X-min = regsub(req.url, "^/varnish/.*?/(.*?)/.*", "1");
set req.http.X-max = regsub(req.url, "^/varnish/.*?/.*?/(.*?)/.*", "1");
synthetic("You are " + client.ip + {"
url: "} + req.url + {"
reason: "} + resp.reason + {"
1st parameter: "} + req.http.X-parameter1 + {"
Have your random number between "} + req.http.X-min + " and " + req.http.X-max + " : " + std.random
(std.real(req.http.X-min, 0), std.real(req.http.X-max, 100)) + {"
End
"});
set resp.status = 200; # Be careful to set it after using resp.reason or it'll overwrite it
return (deliver);
}
return (deliver);
}
31
32. Playing with vcl_synth
$ GET -E http://localhost:8080/varnish/reason/-8/42/
GET http://localhost:8080/varnish/reason/-8/42/
User-Agent: lwp-request/6.03 libwww-perl/6.05
200 OK
Connection: close
Date: Mon, 24 Nov 2014 15:26:12 GMT
Accept-Ranges: bytes
Server: Varnish
Content-Length: 133
Content-Type: text/plain; charset=utf-8
Client-Date: Mon, 24 Nov 2014 15:26:12 GMT
Client-Peer: 127.0.0.1:8080
Client-Response-Num: 1
X-Varnish: 42
You are 127.0.0.1
url: /varnish/reason/-8/42/
reason: Test
1st parameter: reason
Have a random number between -8 and 42 : -2.204
End
32
33. But that's not enough:
$ GET -e http://test/test1.html
200 OK
Connection: close
Date: Fri, 03 Oct 2014 16:37:59 GMT
Accept-Ranges: bytes
ETag: "3d838cc-51-504816b16fe6a"
Server: Apache
Vary: Accept-Encoding
Content-Length: 81
Content-Type: text/html
Last-Modified: Fri, 03 Oct 2014 09:32:57 GMT
33
34. But that's not enough:
# http://httpd.apache.org/docs/2.0/mod/mod_expires.html
ExpiresActive On
ExpiresByType image/gif "access plus 4 days"
#<FilesMatch ".(gif|jpe?g|png)$">
# Header merge Cache-Control "public" # Default anyway
# ExpiresDefault "access plus 4 days"
#</FilesMatch>
ExpiresByType image/jpg "access plus 4 days"
ExpiresByType image/jpeg "access plus 4 days"
ExpiresByType image/png "access plus 4 days"
ExpiresByType image/x-icon "access plus 4 days"
ExpiresByType text/css "access plus 3 days"
ExpiresByType application/x-javascript "access plus 3 days"
ExpiresByType text/html "access plus 4 hours"
ExpiresByType application/xml "access plus 1 hours"
34
35. But that's not enough:
$ GET -e http://test/test1.html
200 OK
Cache-Control: max-age=14400
Connection: close
Date: Fri, 03 Oct 2014 17:37:42 GMT
Accept-Ranges: bytes
ETag: "3d838cc-51-504816b16fe6a"
Server: Apache
Vary: Accept-Encoding
Content-Length: 81
Content-Type: text/html
Expires: Fri, 03 Oct 2014 21:37:42 GMT
Last-Modified: Fri, 03 Oct 2014 09:32:57 GMT
35
36. Numbers on faster hardware
(AMD FX(tm)-8120 Eight-Core Processor 32GB RAM)
/usr/sbin/ab2 -n 500000 -c 200 -k -H "Accept-encoding: gzip" "http:
//localhost/prueba.html"
Requests per second: 24318.71 [#/sec] (mean)
Time per request: 8.224 [ms] (mean)
Time per request: 0.041 [ms] (mean, across all concurrent
requests)
Transfer rate: 8161.06 [Kbytes/sec] received
/usr/sbin/ab2 -n 500000 -c 200 -k -H "Accept-encoding: gzip" "http:
//localhost:8080/prueba.html"
Requests per second: 25780.13 [#/sec] (mean)
Time per request: 7.758 [ms] (mean)
Time per request: 0.039 [ms] (mean, across all concurrent
requests)
Transfer rate: 8611.04 [Kbytes/sec] received 36
37. Resources
● https://www.varnish-cache.org/docs
○ https://www.varnish-software.com/static/book/VCL_Basics.html
○ https://www.varnish-cache.org/trac/wiki
● High Performance Browser Networking by Ilya Grigorik (http:
//chimera.labs.oreilly.com/books/1230000000545/index.html)
● Caching in HTTP (http://www.w3.org/Protocols/rfc2616/rfc2616-
sec13.html)
● The only moment you should ever cache static files is if you have
memory to spare (http://mattiasgeniar.be/2012/11/28/stop-caching-static-
files/)
● How to Use Varnish to Speed up my Website (http://symfony.
com/doc/current/cookbook/cache/varnish.html)
● https://www.varnish-cache.org/vmods (redis, memcache, MySQL,
PostgreSQL, ratelimit, device detection, json, auth, ...)
37