Fastly takes Drupal.org to extremes Faster, more secure, costs under control +
Fastly takes Drupal.org to extremesFaster, more secure, costs under control
+
Drupal.org and Fastly
It started with a "Hey, you should talk with Ed"
fastly.com/open-source
The story so far...
Topics for today's webcastVarnish config / VCL
TLS/SSL security benefits
Logs/data streams
Purge speed
Origin shield
Load balancers no more
Latency Improvements
What's next...
Varnish config / VCL
● We were already running and loved Varnish before adding Fastly.
● We were able to quickly deploy our existing VCL configuration to Fastly.
● With Fastly we can quickly push and revert VCL changes.
TLS/SSL security benefits
Supporting HTTPS and HSTS
● Fastly caches and prevents most of the Drupal.org requests from reaching our Origin servers.
● We know Fastly can handle our raw traffic; one less scaling issue to be concerned with.
Logs/data streams
Every Drupal site in the world can call "home" to Drupal.org to check for updates. We use this data to calculate usage statistics.
Fastly sends logs directly to our rsyslog endpoint in real time.
We get a lot of requests for updates
Purging
150 milliseconds to purge means we can publish new releases in an instant.
Soft purge means we can serve stale objects from Fastly caches while background fetching the newest content from origin.
Request Collapsing
When objects are not in cache, request collapsing in combination with Origin Shield avoids the “Stampeding Herd” and results in a single request to origin from the CDN for a single object.
Origin shieldFirst request
Subsequent requests
What does it mean?
Combining Origin Shield and Soft Purges:
March
62015
March
62016
5,714,472 requests to origin (old CDN)
59,751 requests to origin (Fastly)
1% of the requests with new config means huge savings compared to our previous CDN
Fastly replaced our load balancers
Since Feb. 25th, Drupal.org no longer has load balancers - Fastly performs health checks and routes directly to our web servers.
Lower TCO; less complexity and improved latency.
Latency improvements
Fastly is connected to NERO, NERO is connected to OSL, OSL is connected to Drupal.org.
…everybody wins.
Fastly peering with NERO
● Tag responses with keys● Purge all cached objects associated with a key
in one command
Surrogate Keys
HTTP/1.1 200 OK
Surrogate-Key: tmpl3 artcl938
Content-Type: text/html
Content-Length: 28407
HTTP/1.1 200 OK
Surrogate-Key: tmpl5 artcl938
Content-Type: text/html
Content-Length: 21034
Surrogate Keys
But what about Drupal?
● Basic caching support● Fastly plugin available
● Drupal7’s caching support is very basic● Fastly plugin works, but is even more basic
Drupal 7
Drupal 8
Cache tags
X-Drupal-Cache-Tags: node_view node_view_article node:5 user:1 filter_format:basic_html taxonomy_term:1 taxonomy_term:2 taxonomy_term_view menu:tools menu:footer menu:main menu:account
● Cache tags are surrogate keys● Fastly does have a size limit● Hash the keys & truncate to 3 characters● Purge both variations
Cache tags
Drupal 8
● Very good caching support● Fastly plugin synergizes incredibly well
● Supporting Cache Contexts○ Accept-Language○ Geo-targeting○ Phase of the moon
The future
https://www.fastly.com/
http://buytaert.net/making-drupal-8-fly
http://wimleers.com/talk/caching-at-the-edge-cdns-for-everyone
https://www.drupal.org/project/fastly
Links
Kvestions?