This talk will be a walk through the challenges encountered when building a high profile editorial sites. My goal is to present some of the common pitfalls we have encountered at Lincoln Loop and to explain how we solved:
* Legacy migration always take longer
* devops
* Multiple environment
* Easy deployment
* Responsive design impacts the backend
* Journey of an image
* Picturefill.js
* Danger of reusing published django applications
* Caching strategy
* Html fragment
* Varnish
Audience Decision maker that are going to rebuild their magazine Developer bidding for this kind of projects for the first time
Puppet is a configuration management tool which allows easy deployment and configuration ranging from 1 to 1 thousand servers (and even more). Even though its common knowledge for devops, puppet is still a strange piece of software for developers. How does it work and what can it do for you as a developer?
->Introduction
->>What is Ansible?
->>Ansible history
->Basic concepts
->>Inventory
->>Playbook
->>Role
->>Module
->>Plugin
->Diving into Ansible roles
->>Getting started
->>Create a role
->>Roles under the hood
->>How to use roles?
Puppet is a configuration management tool which allows easy deployment and configuration ranging from 1 to 1 thousand servers (and even more). Even though its common knowledge for devops, puppet is still a strange piece of software for developers. How does it work and what can it do for you as a developer?
->Introduction
->>What is Ansible?
->>Ansible history
->Basic concepts
->>Inventory
->>Playbook
->>Role
->>Module
->>Plugin
->Diving into Ansible roles
->>Getting started
->>Create a role
->>Roles under the hood
->>How to use roles?
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.
Caching and tuning fun for high scalability @ FOSDEM 2012Wim 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.
Caching and tuning fun for high scalability @ phpBenelux 2011Wim Godden
Slides for "Caching and Tuning fun for high scalability" talk, given @ phpBenelux Conference - Jan 28, 2011
Note that a lot of things were explained with each slide... that content is ofcourse not in the slides, so it might make some slides very unclear.
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksCarlos Sanchez
Puppet Modules are a great way to reuse code, share your development with other people and take advantage of the hundreds of modules already available in the community. But how to create, test and publish them as easily as possible? now that infrastructure is defined as code, we need to use development best practices to build, test, deploy and use Puppet modules themselves. Three steps for a fully automated process
* Continuous Integration of Puppet Modules
* Automatic release and upload to the Puppet Forge
* Deploy to Puppet master
Vagrant is a well-known tool for creating development environments in a simple and consistent way. Since we adopted in our organization we experienced several benefits: lower project setup times, better shared knowledge among team members, less wtf moments ;-)
In this session I'd like to share our experience, including but not limited to:
- advanced vagrantfile configuration
- vm configuration tips for dev environment: performance, debug, tuning
- our wtf moments
- puphet/phansilbe: hot or not?
- tips for sharing a box
Preparation study for Docker Event
Mulodo Open Study Group (MOSG) @Ho chi minh, Vietnam
http://www.meetup.com/Open-Study-Group-Saigon/events/229781420/
PHP London Dec 2013 - Varnish - The 9 circles of hellluis-ferro
Varnish is an HTTP accelerator. Its use will allow you to server more content/requests with the same or even less hardware. But with all good things, for each use,the complexity of your solution will increase.
On this talk, I will show how to use Varnish to implement some advanced cache solutions like adding GeoIP processing on varnish and ESI (Edge Side Includes).
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.
Caching and tuning fun for high scalability @ FOSDEM 2012Wim 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.
Caching and tuning fun for high scalability @ phpBenelux 2011Wim Godden
Slides for "Caching and Tuning fun for high scalability" talk, given @ phpBenelux Conference - Jan 28, 2011
Note that a lot of things were explained with each slide... that content is ofcourse not in the slides, so it might make some slides very unclear.
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksCarlos Sanchez
Puppet Modules are a great way to reuse code, share your development with other people and take advantage of the hundreds of modules already available in the community. But how to create, test and publish them as easily as possible? now that infrastructure is defined as code, we need to use development best practices to build, test, deploy and use Puppet modules themselves. Three steps for a fully automated process
* Continuous Integration of Puppet Modules
* Automatic release and upload to the Puppet Forge
* Deploy to Puppet master
Vagrant is a well-known tool for creating development environments in a simple and consistent way. Since we adopted in our organization we experienced several benefits: lower project setup times, better shared knowledge among team members, less wtf moments ;-)
In this session I'd like to share our experience, including but not limited to:
- advanced vagrantfile configuration
- vm configuration tips for dev environment: performance, debug, tuning
- our wtf moments
- puphet/phansilbe: hot or not?
- tips for sharing a box
Preparation study for Docker Event
Mulodo Open Study Group (MOSG) @Ho chi minh, Vietnam
http://www.meetup.com/Open-Study-Group-Saigon/events/229781420/
PHP London Dec 2013 - Varnish - The 9 circles of hellluis-ferro
Varnish is an HTTP accelerator. Its use will allow you to server more content/requests with the same or even less hardware. But with all good things, for each use,the complexity of your solution will increase.
On this talk, I will show how to use Varnish to implement some advanced cache solutions like adding GeoIP processing on varnish and ESI (Edge Side Includes).
Less and faster – Cache tips for WordPress developersSeravo
Otto Kekäläinen, the code-loving CEO of Seravo held a webinar on May 12, 2020, that focused on the cache: what should a WordPress developer know and which are the best practices to follow?
These slides show how to reduce latency on websites and reduce bandwidth for improved user experience.
Covering network, compression, caching, etags, application optimisation, sphinxsearch, memcache, db optimisation
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.
Nagios Conference 2014 - Andy Brist - Nagios XI Failover and HA SolutionsNagios
Andy Brist's presentation on High Availability and Failover Solutions for Nagios XI. The presentation was given during the Nagios World Conference North America held Oct 13th - Oct 16th, 2014 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/conference
One-Man Ops with Puppet & Friends.
If you're getting started in Amazon AWS here's 7 tools that will help you be successful, a few tips to make your life easier and some common pitfalls to avoid.
A presentation I gave on September 26 at the Melbourne Symfony developers group on using Environment Variables (envvars) in Symfony and managing secrets in your PHP applications.
For more information on these subjects, check out the supporting piece I wrote: https://samjarrett.com.au/swipe-right
Webinar Slides: New Tungsten Dashboard - Overview, Installation and ArchitectureContinuent
Tungsten Dashboard is our graphical user interface (GUI) for managing your Tungsten MySQL clusters interactively using a web browser, on your desktop, laptop, tablet or mobile. In our session, we'll provide a Tungsten Dashboard overview and discuss architecture, pre-requisites and security limitations.
AGENDA
- Configure the Tungsten Cluster Manager API
- Install and configure the Tungsten Dashboard
- Configure the Apache 2.4 web server
- Test connectivity to the Tungsten Manager API directly
- Install and configure HA proxy
- Test connectivity to the Tungsten Manager API via HA proxy
- Access the Tungsten Dashboard via a browser
Training Slides: Basics 106: Tungsten Dashboard Overview, Installation and Ar...Continuent
In this training session, we'll provide a Tungsten Dashboard overview and discuss architecture, pre-requisites and security limitations. A simple GUI management tool for Tungsten Clustering for MySQL / MariaDB / Percona Server, the Dashboard is usually installed on a standalone web server with HAProxy installed. This training session uses an example of a 6-node composite cluster.
AGENDA
- Tungsten Dashboard Welcome
- Tungsten Dashboard Overview
- Tungsten Dashboard Prerequisites
- Tungsten Dashboard Security Limitations
- Configure the Tungsten Cluster Manager API
- Test Connectivity to the Tungsten Manager API Directly
- Install the Tungsten Dashboard
- Install and Configure the Apache 2.4 Web Server
- Configure the Tungsten Dashboard
- Install and Configure HAProxy
- Test Connectivity to the Tungsten Manager API via HAProxy
- Access the Tungsten Dashboard GUI via a Browser
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Online aptitude test management system project report.pdfKamal Acharya
The purpose of on-line aptitude test system is to take online test in an efficient manner and no time wasting for checking the paper. The main objective of on-line aptitude test system is to efficiently evaluate the candidate thoroughly through a fully automated system that not only saves lot of time but also gives fast results. For students they give papers according to their convenience and time and there is no need of using extra thing like paper, pen etc. This can be used in educational institutions as well as in corporate world. Can be used anywhere any time as it is a web based application (user Location doesn’t matter). No restriction that examiner has to be present when the candidate takes the test.
Every time when lecturers/professors need to conduct examinations they have to sit down think about the questions and then create a whole new set of questions for each and every exam. In some cases the professor may want to give an open book online exam that is the student can take the exam any time anywhere, but the student might have to answer the questions in a limited time period. The professor may want to change the sequence of questions for every student. The problem that a student has is whenever a date for the exam is declared the student has to take it and there is no way he can take it at some other time. This project will create an interface for the examiner to create and store questions in a repository. It will also create an interface for the student to take examinations at his convenience and the questions and/or exams may be timed. Thereby creating an application which can be used by examiners and examinee’s simultaneously.
Examination System is very useful for Teachers/Professors. As in the teaching profession, you are responsible for writing question papers. In the conventional method, you write the question paper on paper, keep question papers separate from answers and all this information you have to keep in a locker to avoid unauthorized access. Using the Examination System you can create a question paper and everything will be written to a single exam file in encrypted format. You can set the General and Administrator password to avoid unauthorized access to your question paper. Every time you start the examination, the program shuffles all the questions and selects them randomly from the database, which reduces the chances of memorizing the questions.
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
Planning Of Procurement o different goods and services
Challenges when building high profile editorial sites
1. !
BUILDING HIGH PROFILE
EDITORIAL SITES
YANN MALET
2014.DJANGOCON.EU
MAY 2014
2. ABOUT THIS TALK
● It comes after
− Data Herding: How to Shepherd Your Flock Through
Valleys of Darkness (2010)
− Breaking down the process of building a custom
CMS (2010)
− Stop Tilting at Windmills - Spotting Bottlenecks
(2011)
3. AGENDA
● Foreword
● Multi layer cache to protect your database
● Image management on responsive site
● Devops
8. VARNISH
● Varnish Cache is a web application accelerator
− aka caching HTTP reverse proxy
− 10 – 1000 times faster
!
● This is hard stuff don't try to reinvent this wheel
9. VARNISH: TIPS AND TRICKS
● Strip cookies
● Saint Mode
● Custom error better than guru meditation
10. STRIP COOKIES
● Increasing hit rate is all about reducing
− Vary: on parameters
● Accept-Language
● Cookie
11. STRIP COOKIES
sub vcl_recv {
# unless sessionid/csrftoken is in the request,
# don't pass ANY cookies (referral_source, utm, etc)
if (req.request == "GET" &&
(req.url ~ "^/static" ||
(req.http.cookie !~ "sessionid" &&
req.http.cookie !~ "csrftoken"))) {
remove req.http.Cookie;
}
...
}
sub vcl_fetch {
# pass through for anything with a session/csrftoken set
if (beresp.http.set-cookie ~ "sessionid" ||
beresp.http.set-cookie ~ "csrftoken") {
return (pass);
} else {
return (deliver);
}
...
}
12. VARNISH: SAINT MODE
● Varnish Saint Mode lets you serve stale content
from cache, even when your backend servers are
unavailable.
− http://lincolnloop.com/blog/varnish-saint-mode/
13. VARNISH: SAINT MODE 1/2
# /etc/varnish/default.vcl
backend default {
.host = "127.0.0.1";
.port = "8000";
.saintmode_threshold = 0;
.probe = { .url = "/"; .interval = 1s; .timeout = 1s;
.window = 5; .threshold = 3;}
}
sub vcl_recv {
if (req.backend.healthy) {
set req.grace = 1h;
set req.ttl = 5s;
} else {
# Accept serving stale object (extend TTL by 6h)
set req.grace = 6h;
}
}
14. VARNISH: SAINT MODE 2/2
!
sub vcl_fetch {
# keep all objects for 6h beyond their TTL
set beresp.grace = 6h;
!
# If we fetch a 500, serve stale content instead
if (beresp.status == 500 ||
beresp.status == 502 ||
beresp.status == 503) {
set beresp.saintmode = 30s;
return(restart);
}
}
15. VARNISH: SAINT MODE
.url: Format the default request with this URL.
.timeout: How fast the probe must finish, you must specify a time
unit with the number, such as “0.1 s”, “1230 ms” or even “1 h”.
.interval: How long time to wait between polls, you must specify a
time unit here also. Notice that this is not a ‘rate’ but an ‘interval’. The
lowest poll rate is (.timeout + .interval).
.window: How many of the latest polls to consider when determining
if the backend is healthy.
.threshold: How many of the .window last polls must be good for
the backend to be declared healthy.
16. VARNISH: CUSTOM ERROR PAGE
sub vcl_error {
...
# Otherwise, return the custom error page
set obj.http.Content-Type = "text/html; charset=utf-8";
synthetic std.fileread("/var/www/example_com/varnish_error.html");
return(deliver);
}
● Use a nicely formatted error page instead of the
default white meditation guru
18. INEVITABLE QUOTE
!
„THERE ARE ONLY TWO HARD THINGS IN
COMPUTER SCIENCE:
CACHE INVALIDATION AND NAMING
THINGS, AND OFF-BY-ONE ERRORS.“
!
– PHIL KARLTON
19. CACHING STRATEGY
● Russian doll caching
● Randomized your cache invalidation for the
HTML cache
● Cache buster URL for your HTML cache
● Cache database queries
● More resilient cache backend
20. RUSSIAN DOLL CACHING
● Nested cache with increasing TTL as you walk down
{% cache MIDDLE_TTL "article_list"
request.GET.page last_article.id last_article.last_modified %}
{% include "includes/article/list_header.html" %}
<div class="article-list">
{% for article in article_list %}
{% cache LONG_TTL "article_list_teaser_" article.id article.last_modified %}
{% include "includes/article/article_teaser.html" %}
{% endcache %}
{% endfor %}
</div>
{% endcache %}
22. ● Do not invalidate all the `X_TTL` at the same time
− Modify cache templatetag: TTL +/- 20%
● Fork the {% cache … %} templatetag
try:
RANDOMIZED CACHE TTL
expire_time = int(expire_time)
expire_time = randint(expire_time * 0.8, expire_time * 1.2)
except (ValueError, TypeError):
raise TemplateSyntaxError(
'"cache" tag got a non-integer timeout value: %r' % expire_time)
23. CENTRAL TTL DEFINITION
● Context processor to set TTL
− SHORT_TTL
− MIDDLE_TTL
− LONG_TTL
− FOR_EVER_TTL (* not really)
24. RESILIENT CACHE BACKEND
● Surviving node outages is not included
− Wrap the Django cache backend in try / except
− You might also want to report it in New Relic
● Fork Django cache backend
25. CACHE BUSTER URL
● http://example.com/*/?PURGE_CACHE_HTML
● This URL
− traverses your stack
− purges the HTML cache fragment
− generates fresh one
!
● Fork the {% cache … %} templatetag
26. CACHING DB QUERIES
● Johnny cache
− It is a middleware so there is surprising side effects
− If you change the DB outside request / response
# johnny/cache.py
def enable():
"""Enable johnny-cache, for use in scripts, management
commands, async workers, or other code outside the Django
request flow."""
get_backend().patch()
31. IMAGE MANAGEMENT
● Django-filer
● Easy-thumbnails
● Cloudfiles (cloud containers)
!
● Assumption of fast & reliable disk should be forgotten
− The software stack is not helping, a lot of work is left to you
● Forked
− Dajngo-filer (fork)
− Easy-thumbnails (Fork - very close to to be able to drop it)
− Django-cumulus (81 Forks)
− Monkey patch pyrax
− ...
Heein!!!
32. DJANGO-CUMULUS
● The truth is much worst
− Log everything from the swiftclient
● Target 0 calls to the API and DB on a hot page
− The main repo is getting better ...
'loggers': {
...
'Django.db': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
'swiftclient': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
33. DJANGO-CUMULUS
● Django storage backend for Cloudfiles from Rakspace
− Be straight to the point when talking to slow API
diff --git a/cumulus/storage.py b/cumulus/storage.py
@@ -201,6 +202,19 @@ class SwiftclientStorage(Storage):
...
+ def save(self, name, content):
+ """
+ Don't check for an available name before saving, just overwrite.
+ """
+ # Get the proper name for the file, as it will actually be saved.
+ if name is None:
+ name = content.name
+ name = self._save(name, content)
+ # Store filenames with forward slashes, even on Windows
+ return force_text(name.replace('', '/'))
34. DJANGO-CUMULUS
Trust unreliable API at scale
diff --git a/cumulus/storage.py b/cumulus/storage.py
@@ -150,8 +150,11 @@ class SwiftclientStorage(Storage):
def _get_object(self, name):
"""
Helper function to retrieve the requested Object.
"""
- if self.exists(name):
+ try:
return self.container.get_object(name)
+ except pyrax.exceptions.NoSuchObject as err:
+ pass
@@ -218,7 +221,7 @@ class SwiftclientStorage(Storage):
def exists(self, name):
"""
exists in the storage system, or False if the name is
available for a new file.
"""
- return name in self.container.get_object_names()
+ return bool(self._get_object(name))
35. PATCH PYRAX
● Assume for the best
− Reduce the auth attempts
− Reduce the connection timeout
def patch_things():
# Automatically generate thumbnails for all aliases
models.signals.post_save.connect(queue_thumbnail_generation)
# Force the retries for pyrax to 1, to stop the request doubling
pyrax.cf_wrapper.client.AUTH_ATTEMPTS = 1
pyrax.cf_wrapper.client.CONNECTION_TIMEOUT = 2
36. GENERATE THE THUMBS
● Generate the thumbs as soon as possible
− post save signals that offload to a task
− easy-thumbnails
def queue_thumbnail_generation(sender, instance, **kwargs):
"""
Iterate over the sender's fields, and if there
is a FileField instance (or a subclass like
MultiStorageFileField) send the instance to a
task to generate All the thumbnails defined
in settings.THUMBNAIL_ALIASES.
"""
…
37. PICTUREFILL.JS
… A Responsive Images approach that you can
use today that mimics the proposed picture
element using spans...
− Old API demonstrated 1.2.1
<span data-picture data-alt="A giant stone facein Angkor Thom, Cambodia">
<span data-src="small.jpg"></span>
<span data-src="medium.jpg" data-media="(min-width: 400px)"></span>
<span data-src="large.jpg" data-media="(min-width: 800px)"></span>
<span data-src="extralarge.jpg" data-media="(min-width: 1000px)"></span>
<!-- Fallback content for non-JS browsers. Same img src as the initial,
unqualified source element. -->
<noscript>
<img src="small.jpg" alt="A giant stone face in Angkor Thom, Cambodia">
</noscript>
</span>
38. PUTTING IT ALL TOGETHER 1/2
● Iterate through article_list
● Nested cache
<!-- article_list.html -->
{% extends "base.html" %}
{% load image_tags cache_tags pagination_tags %}
{% block content %}
{% cache MIDDLE_TTL "article_list_" category author tag request.GET.page all_pages %}
<div class="article-list archive-list ">
{% for article in object_list %}
{% cache LONG_TTL "article_teaser_" article.id article.modified %}
{% include "newsroom/includes/article_teaser.html" with columntype="categorylist" %}
{% endcache %}
{% endfor %}
</div>
{% endcache %}
39. PUTTING IT ALL TOGETHER 2/2
<!-- article_teaser.html -->
{% load image_tags %}
<section class="blogArticleSection">
{% if article.image %}
<a href="{{ article.get_absolute_url }}" class="thumbnail">
<span data-picture data-alt="{{ article.image.default_alt_text }}">
<span data-src="{{ article.image|thumbnail_url:"large" }}"></span>
<span data-src="{{ article.image|thumbnail_url:"medium" }}" data-media="(min-width: 480px)"></span>
<span data-src="{{ article.image|thumbnail_url:"small" }}" data-media="(min-width: 600px)"></span>
<noscript>
<img src="{{ article.image|thumbnail_url:"small" }}" alt="{{ article.image.default_alt_text }}">
</noscript>
</span>
</a>
{% endif %}
...
Use Picturefill to render your images
40. AGENDA
● Foreword
● Multi layer cache to protect your database
● Image management on responsive site
● Devops
41. DEVOPS
● Configuration management
● Single command deployment for all
environments
● Settings parity
42. CONFIGURATION MANAGEMENT
● Pick one that fits your brain & skillset
− Puppet
− Chef
− Ansible
− Salt
● At Lincoln Loop we are using Salt
− One master per project
− Minion installed on all the cloud servers
43. SALT
● Provision & deploy a server role
● +X app servers to absorb a traffic spike
● Replace an unsupported OS
● Update a package
● Run a one-liner command
− Restart a service on all instances
● Varnish, memcached, ...
− Check the version
44. SINGLE COMMAND DEPLOYMENT
● One-liner or you will get it wrong
● Consistency for each role is critical
− Avoid endless debugging of pseudo random issue
45. SETTING PARITY
● Is the Utopia you want to tend to but …
− There are some differences
● Avoid logic in settings.py
● Fetch data from external sources: .env
47. CONCLUSION
● Multi-layer Cache to protect your database
− Varnish
− Russian doll cache for the HTML fragments
● Smart key naming and invalidation condition
● Cache buster URL
● Image management
− Harder on high traffic responsive site
− Software stack not mature
● Devops
− Configuration management is a must
− Try to have settings parity between your environment
50. A WORD ABOUT LEGACY MIGRATION
● This is often the hardest part to estimates
− Huge volume of data
− Often inconsistent
− Unknown implicit business logic
!
● At scale if something can go wrong it will
● It always take longer
51. REUSING PUBLISHED
APPLICATIONS
● Careful review before adding an external requirements
− Read the code
● Best practice
● Security audit
− Can operate at your targeted scale
− In line with the rest of your project
● It is not a binary choice you can
− extract a very small part
− Write your own version based on what you learned