This document summarizes notes from several talks and discussions about scaling Ruby on Rails applications. Some key points include:
- To scale a Rails app, focus on load balancing and separating application tiers (front-end servers, application servers, databases). Use caching, database replication, and queuing systems.
- Monitoring tools like Munin and Nagios are important for tracking performance bottlenecks. Metrics like requests per second help determine capacity.
- Scaling the database is critical; techniques include sharding, replication, and optimizing queries with indexing. Caching data in Memcached also helps scale performance.
- Virtualization allows consolidating servers. Software load balancers like Nginx can route
This is a copy of the NoSQL Day 2019 session presented in Washington D.C on May 2019. It covers a series of the most common HBase issues observed among Cloudera customer base, together with RCA and recipes for recovery.
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Marcus Barczak
Relying on a single content delivery network for your site can impose a number of flexibility limitations. By diversifying your CDN providers you can put the power back in your hands, allowing you to get the best of both worlds in terms of performance, reliability and cost. In this talk Marcus and Laurie will present Etsy’s recent work integrating multiple CDN providers to their site delivery infrastructure.
This presentation was delivered at Velocity Europe, November 2013
Over the years, DevOps has evolved in many aspects: from best practices, to the responsibilities of an operations engineer, to culture, the ever-changing landscape of infrastructure brings new, exciting discoveries… but also some never before seen issues! I always keep a careful record of all the problems we’ve troubleshot because you never know when a solution will come in handy. This session tells a couple of tales of dealing with databases and how troubleshooting has evolved over time.
Constructing Web APIs with Rack, Sinatra and MongoDBOisin Hurley
Slides for my talk at Ruby Ireland on 10 May 11. Showing some of the capabilities of mongoDB, using it from a Sinatra applications and deploying it to Heroku and Cloud Foundry
This is a copy of the NoSQL Day 2019 session presented in Washington D.C on May 2019. It covers a series of the most common HBase issues observed among Cloudera customer base, together with RCA and recipes for recovery.
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Marcus Barczak
Relying on a single content delivery network for your site can impose a number of flexibility limitations. By diversifying your CDN providers you can put the power back in your hands, allowing you to get the best of both worlds in terms of performance, reliability and cost. In this talk Marcus and Laurie will present Etsy’s recent work integrating multiple CDN providers to their site delivery infrastructure.
This presentation was delivered at Velocity Europe, November 2013
Over the years, DevOps has evolved in many aspects: from best practices, to the responsibilities of an operations engineer, to culture, the ever-changing landscape of infrastructure brings new, exciting discoveries… but also some never before seen issues! I always keep a careful record of all the problems we’ve troubleshot because you never know when a solution will come in handy. This session tells a couple of tales of dealing with databases and how troubleshooting has evolved over time.
Constructing Web APIs with Rack, Sinatra and MongoDBOisin Hurley
Slides for my talk at Ruby Ireland on 10 May 11. Showing some of the capabilities of mongoDB, using it from a Sinatra applications and deploying it to Heroku and Cloud Foundry
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Sascha Wenninger
Provides an overview of popular integration approaches, maps them to SAP's integration tools and concludes with some lessons learnt in their application.
In this slide deck we show how to implement custom Kafka Serializer for Producer. We then show how failover works configuring when broker/topic config min.insync.replicas, and Producer config acks (0, 1, -1, none, leader, all).
Then tutorial show how to implement Kafka producer batching and compression. Then use Producer metrics API to see how batching and compression improves throughput. Then this tutorial covers using retires and timeouts, and tested that it works. It explains how the setup of max inflight messages and retry back off work and when to use and not use inflight messaging.
It goes on to who how to implement a ProducerInterceptor. Then lastly, it shows how to implement a custom Kafka partitioner to implement a priority queue for important records. Through many of the step by step examples, this tutorial shows how to use some of the Kafka tools to do replication verification, and inspect the topic partition leadership status.
Making the case for the consideration of network topologies on the performance of UI technologies, and presenting some sample measurements across traditional SAP GUI, WebDynpro for ABAP, and the UI5-based Fiori apps.
An updated (and less technical) slide pack presented as a keynote at Mastering SAP Technologies 2013 in South Africa covering some of the lessons we learned implementing SAP Process Integration over the years.
Building highly scalable website requires to understand the core building blocks of your applicative environment. In this talk we dive into Jahia core components to understand how they interact and how by (1) respecting a few architectural practices and (2) fine tuning Jahia components and the JVM, you will be able to build a highly scalable service
From common errors seen in running Spark applications, e.g., OutOfMemory, NoClassFound, disk IO bottlenecks, History Server crash, cluster under-utilization to advanced settings used to resolve large-scale Spark SQL workloads such as HDFS blocksize vs Parquet blocksize, how best to run HDFS Balancer to re-distribute file blocks, etc. you will get all the scoop in this information-packed presentation.
Slides from my Planning to Fail talk given at PHP North East conference 2013. This is a slightly longer version of the same talk given at the PHP UK conference. The talk was on how you can build resilient systems by embracing failure.
Deepankar Reddy and Ishan Chhabra (Rocket Fuel)
Rocket Fuel is a marketing technology company that participates in 120+ billion real-time bidding auctions daily to show the right ad to the right user at the right time for our clients. In this talk, we discuss our efforts to systematically identify causes of, and how to decrease, long-tail read latencies.
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Sascha Wenninger
Provides an overview of popular integration approaches, maps them to SAP's integration tools and concludes with some lessons learnt in their application.
In this slide deck we show how to implement custom Kafka Serializer for Producer. We then show how failover works configuring when broker/topic config min.insync.replicas, and Producer config acks (0, 1, -1, none, leader, all).
Then tutorial show how to implement Kafka producer batching and compression. Then use Producer metrics API to see how batching and compression improves throughput. Then this tutorial covers using retires and timeouts, and tested that it works. It explains how the setup of max inflight messages and retry back off work and when to use and not use inflight messaging.
It goes on to who how to implement a ProducerInterceptor. Then lastly, it shows how to implement a custom Kafka partitioner to implement a priority queue for important records. Through many of the step by step examples, this tutorial shows how to use some of the Kafka tools to do replication verification, and inspect the topic partition leadership status.
Making the case for the consideration of network topologies on the performance of UI technologies, and presenting some sample measurements across traditional SAP GUI, WebDynpro for ABAP, and the UI5-based Fiori apps.
An updated (and less technical) slide pack presented as a keynote at Mastering SAP Technologies 2013 in South Africa covering some of the lessons we learned implementing SAP Process Integration over the years.
Building highly scalable website requires to understand the core building blocks of your applicative environment. In this talk we dive into Jahia core components to understand how they interact and how by (1) respecting a few architectural practices and (2) fine tuning Jahia components and the JVM, you will be able to build a highly scalable service
From common errors seen in running Spark applications, e.g., OutOfMemory, NoClassFound, disk IO bottlenecks, History Server crash, cluster under-utilization to advanced settings used to resolve large-scale Spark SQL workloads such as HDFS blocksize vs Parquet blocksize, how best to run HDFS Balancer to re-distribute file blocks, etc. you will get all the scoop in this information-packed presentation.
Slides from my Planning to Fail talk given at PHP North East conference 2013. This is a slightly longer version of the same talk given at the PHP UK conference. The talk was on how you can build resilient systems by embracing failure.
Deepankar Reddy and Ishan Chhabra (Rocket Fuel)
Rocket Fuel is a marketing technology company that participates in 120+ billion real-time bidding auctions daily to show the right ad to the right user at the right time for our clients. In this talk, we discuss our efforts to systematically identify causes of, and how to decrease, long-tail read latencies.
GGJ2013 Global Game Jam informational presentationRafael Fajardo
Informational presentation about Global Game Jam 2013 at the University of Denver, Colorado, USA. Information drawn from GlobalGameJam.org/faq. This information is intended for local consumption, but draws on the global wisdom.
Empowering the AWS DynamoDB™ application developer with AlternatorScyllaDB
Getting started with AWS DynamoDB™ is famously easy, but as an application grows and evolves it often starts to struggle with DynamoDB’s limitations. We introduce Scylla’s Alternator, which provides the same API as DynamoDB but aims to empower the application developer. In this presentation we will survey some of Alternator’s developer-centered features: Alternator lets you test and eventually deploy your application anywhere, on any public cloud or private cluster. It efficiently supports multiple tables so it does not require difficult single-table design. Finally, Alternator provides the developer with strong observability tools. The insights provided by these tools can detect bottlenecks, improve performance and even lower its cost.
Storage Systems for High Scalable Systems Presentationandyman3000
Presentation from http://www.hfadeel.com/Blog/?p=151 what kind of storage systems players like Facebook or Google use for their extreme scalability requirements
How to make successful use of the cloud for your software startup. Based on 4 years of using various cloud services. Includes advice, war stories, and best practices.
Presented at CoderFaire Atlanta 2013.
The presentation which I was using during my talk at EPAM Lviv JS community about offline-first applications. Contains high-level review of tools and web platform to submerge folks in a world of offline-first thinking.
Quilt - Distributed Load Simulation from AWSAjith Jose
A distributed load testing tool to generated 100s of thousands of audio video endpoints along with all the API calls and WebSocket connections it needs!
We designed the load generation tool as a highly scalable distributed system, as it needs a lot of computing power to simulate 100K+ automated endpoints. It starts 100s of AWS/GCP instances before starting the fire. Fully automated, Get - Set - Fire !
Those days, when it seemed, that web applications have overthrown standard “cumbersome” client apps, we’ll speak about present and future of consumer oriented desktop applications. This includes, but not restricted to patterns of LOB applications development with WPF, right multimedia support of DirectX bridge and new features, waiting for you in Windows 7. Also we’ll speak about subject oriented programming, will be introduced in NET. 4.0 and how to leverage it even today with the current version of Microsoft framework. tits will be shown during the session, thus restricted to mature audiences
This presentation, given by Dave Rosenthal at NoSQL Now! 2013, presents the case for why he believes NoSQL databases will need to support ACID transactions in order for developers to more easily build, deploy, and scale applications in the future.
2019 StartIT - Boosting your performance with BlackfireMarko Mitranić
A workshop held in StartIT as part of Catena Media learning sessions.
We aim to dispel the notion that large PHP applications tend to be sluggish, resource-intensive and slow compared to what the likes of Python, Erlang or even Node can do. The issue is not with optimising PHP internals - it's the lack of proper introspection tools and getting them into our every day workflow that counts! In this workshop we will talk about our struggles with whipping PHP Applications into shape, as well as work together on some of the more interesting examples of CPU or IO drain.
The use of containers to simplify and speed the deployment and development of applications is taking off. Most container usage is around stateless micro-services, but data and transactions are key components of most applications.
This presentation reviews:
- The purpose of containers and their usage
- How to containerize your EDB Postgres deployment
- How to deal with issues of managing your database and storage
- How to set up a cluster for high availability
- How to build a container with the EDB Postgres Enterprise Manager Agent in the container
Target Audience:
This technical presentation is for DBAs, Data Architects, Developers, DevOps, IT Operations and anyone responsible for supporting a Postgres interested in learning about Containers. It is equally suitable for organizations using community PostgreSQL as well as EDB’s Postgres Plus product family.
To listen to the recording which includes a demonstration, visit EnterpriseDB > Resources > Webcasts
Development to Production with Sharded MongoDB ClustersSeveralnines
Severalnines presentation at MongoDB Stockholm Conference.
Presentation covers:
- mongoDB sharding/clustering concepts
- recommended dev/test/prod setups
- how to verify your deployment
- how to avoid downtime
- what MongoDB metrics to watch
- when to scale
Enterprise Cloud Databases are fully managed and clustered databases tailored for production needs.
OVH takes care of all the infrastructure setup, you end up with you SQL access and are able to focus on your business.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Rails Conf Europe 2007 Notes
1. RailsConf Europe 2008 Berlin Notes
by Marston Alfred (marston@sugarstats.com)
http://www.marstononline.com/
Re-Factoring Rails Notes:
By Trotter Cashion (cashion@gmail.com)
rCov – Test Coverage
•
o gem install –y rcov
o rcov test/unit/*.rb test/functional/*.rb
o Standard Rails Test Generation doesn’t cover all code, don’t trust it.
Nearly impossible to re-factor if you don’t have good tests.
•
Try to get as much test coverage of your app as possible.
•
Clean code makes it really easy to cache information and variables
•
We don’t re-factor because of deadlines – You have to say “No, it isn’t ready yet.”
•
Explain it to managers in a business sense/scenario.
•
People don’t re-factor because they don’t write tests
•
What to not re-factor?
•
o When adding new features? (in the initial moment when adding the
feature. Re-Factor AFTER the tests pass and it works then re-factor.
o When Killing Bugs.
What tools do you need?
•
o Use rCov (test coverage gem) – Tells you what percentage of your code
that your tests are covering and which percentage it isn’t. i.e: 19% of your
helpers aren’t being tested.
o Use auto test tools (ZenTest/AutoTest) – Runs tests for you all the time.
o Use grep? (Textmate can do project wide search).
o SpiderTest – Spiders your views, clicks on links. If something fails you
will know. Great for view testing.
o Selenium – Like SpiderTools for view testing.
Use before_filters everywhere, make things simpler and better.
•
Though if the before_filter only applies to one method, move it into the method.
•
CRUD Re-Factoring:
•
o Test, Make Test Break, Test the Method.
o Common naming: test_new, test_create, test_destroy, test_update
2. o Don’t use “pubsh_with_attributes” Depricated. Used to be used with
has_and_belongs_to_many
Remember YAGNI (You ain’t gonna need it). You think you’ll need it, but you
•
really don’t.
Basic 4 rules for re-factoring:
•
o Move attributes and associations – When an attribute is being used more
by another class. Many times, the need to load the current class just to
retrieve this one attribute is a drain on performance. Removing/Moving
associations removes middleman and costly joins.
o Move Methods (in models) – When a method uses more attributes from a
different class than it does from its defining class.
o Move Methods (in controllers) – When the method uses objects/attributes
typically governed by another controller.
Scaling a Rails Application Notes:
Questions like: How scale from 1 DC to multiple Data centers across the globe
•
and still maintain a unified back-end and only have my costs multiple by 1x per
DC.
Slingshot about making a Rails app an offline desktop app.
•
TextDrive deploys 10 new servers every 2-4 days.
•
“Scalability” independent of “performance”. Things can be slow and still scale.
•
Rules of Ten:
•
o Tiers are different functionally
o Tiers should be 10x different in throughput
o Infrastructure costs <= 10% of “revenue”
Web Apps are stateless – Of course.
•
o Inherently “scalable”
o LB -> App -> Back-end
Types of Scalability:
•
o Load – If I have 1 thing that is 100% utilized, if I add 9 more then I should
have 10 things that are 10% utilized
o Geographic – Can I separate things across the world and have it scale to
each in a balanced way.
o Administrative – Most expensive, as we scale hardware/software can I
scale the people needed to maintain them in a cost effective manner.
How many servers fit into 100kw? Around 250-400 servers.
•
1Gbps = 125MB/s, 100Mbsp = 12.5MB/s
•
100Mbps usually around $5000-$8000/month. ($50-$80 per MB per Second)
•
3. BigIP’s can do 20k-100k RPS easy. Apache, Lighty or LSWS can do 1k-15k
•
proxy static request/s
Google spends 10% of their revenue on server/hardware/infrastructure. That
•
includes CC processing charges. $307 million in 2006.
I.E: if you’re making $1 million a year, you should be spending $100,000/yr on
•
infrastructure.
Joyent builds in racks of 3 with a 4th admin app. 1 is app rack, storage rack and
•
multi-core rack for processing heavy things.
Keep things standardized, simple and use open technologies.
•
You need to understand what a given “component” can do at a minimum and
•
maximum (i.e a single server, a single VPS, a single proxy)
It is generally cheaper at the $20-30k/month spending range to do hosting “in-
•
house” i.e buy your own hardware etc, collocate. Assuming you have a good
network admin and know what you’re doing.
Joyent used to do all their hosting at “The Planet”. Had problems, bad data
•
centers. “It looks like a robot vomited.”
If you run your own hardware, keep one kind of:
•
o Console server
o Switch
o Server
o CPU
o RAM
o Storage
o Disc
o OS
o Interconnect
o Powerplug
o Powerstrip
Color code cabling
•
They had SAN, got rid of it for ZFS.
•
People don’t know how to scale DB’s and don’t know how to store files.
•
Level 3 and Equinx good tier1 providers.
•
Typical costs:
•
o $500-$750 for a rack
o $500-1k for power per rack
o $1k for bandwidth
o $4k for systems
o A great sysadmin/racker is $100k+ (hah!)
o $6500 for 20 systems in a rack on a lease.
What do you run on servers? VIRTUALIZE!! (Xen, VMware, Solaris Zones)
•
VMWare is around $2k per server. Better for “Administrative Scalability”.
•
4. Do you “get” linear performance? Typically no, usually take a 10-20%
•
performance hit. Things are getting better.
Lessons learned:
•
o Write separate apps that do one thing and talk to each other via web
services.
Typical Server Setup:
•
o 1x – 16GB, 4 Core AMD Box
o 4 VPS’
o 10 Mongrels per CPU/Core (10 per CPU)
Scale Process:
•
o Run more and more processes
o They should add up, in the front and in the back. Should add up linearly.
In Front: Load Balancers (Hardware). In Back: DB Middleware (Sequoia)
•
DNS Federation: Easy way to split users into pods. User.dns.com instead of
•
dns.com/user
BingoDisk does this. Use PDNS (Power DNS). Run on FreeBSD. MySQL
•
Backend. Master/Slace MySQL instead of Master/Slave PDNS.
Joyent uses “predictive” on Mongrels.
•
Layer7 Load Balancing is great. Separate mongrels for different parts of app. i.e:
•
signup/login pages served faster.
Wordpress.com does DNS Federation.
•
When doing stress testing, use ab or httperf. Us against ONE mongrel. Base it off
•
that. Then try against 10. Base your LB against that.
Software Load Balancers:
•
o Varnish – 10k RPS
o BigIP: 100k RPS
o Nginx/LSWS: 1k RPS
o HA Proxy: ?
Varnish also does caching. On some apps, server 80-90% of requests from cache,
•
good like squid.
Varnish has VCL language too. Makes it easy to config via web services. Purge
•
cache from web service for example. Easy to purge cache via Rails app.
Nginx: Good for LB + Static Content.
•
Nginx -> Mongrel -> MySQL = 1k RPS Easy
•
Vanish -> Nginx -> Mongrel -> MySQL = 10k RPS w/ Varnish Cache to server
•
lots of requests.
5. Use “Browser Pipelining” via several static servers with different domain names.
•
BingoDisk not so good for small asset storing/serving. 2GB uplink. Good for
•
large files.
Offload static content to CDN at the 20k/rps area.
•
Memcache helps you “deal” with Scalability in the backend.
•
Use Squoia as a DB middleman for DB replication. Makes MySQL DB dumb.
•
“RAIDED Databases.” You can program DB sharding with it.
Nginx/LSWS good up to 1000 RPS, then Hardware Load Balancers are needed.
•
Static server naming: (assets1-4.domain.com, assets5-8.domain.com)
•
ActiveRecord and SDO Notes:
SDO and AR are similar
•
Allows developers to focus on things that are useful.
•
SCA’s are like SDO but include encryption, auth etc
•
SDO = Service Data Objects
•
SCA = Service Control Architecture
•
Boring… Leaving.
•
Talks with EngineYard:
Switched from CoyotePoint LoadBalancers to using LVS Open-source project.
Much more flexible.
CoyotePoint just couldn’t keep up with their specific setup. Thousands of static
IP’s pointing to many clusters. It just wasn’t what they were setup for.
MySQL Setup is Amazing. 4 Sata HD’s per server dedicated to MySQL. 2x in
RAID1 for Master, 2x RAID1 for Slave. Then syncs to bigger replication slices.
3GB MySQL Slices, also have 6GB Slices and dedicated slices/servers for bigger
sites. Also backups go to SAN.
Uses GFS with the CoRaid SAN’s.
CoRaid has 16 and 24 drive SAN’s. 10Gbps Ethernet connections. AOE: Ethernet
without the TCP overhead. Uses standard SATA drives, want more stored? Just
add more disks. They have MANY CoRaid’s in their racks.
6x 1Gbps Ethernet ports per server.
2x (2Gbps) dedicated to SAN Storage per server.
Dedicated, redundant servers for Mail, DNS and SVN also
eXtreme Networks Super High performance Switches in between servers and
SAN.
Use Cacti / Nagios for Monitoring. Also Monit.
6. Custom Gentoo Setup for Application Slices. 640MB each, ONLY for mongrels.
Bare-Bones setup just enough to serve the app. 4 x Mongrels per slice. Event-
driven if needed. 100% utilization of 1 core. Usually 8 or 16 core CPU’s per
server.
2 production slices (Load Balanced) can easily do 80RPS (4.5 Million
DYNAMIC requests per day). Static files quickly served by Nginx.
Redundant, Dual Switched Servers.
Dual Network Connections to Public Internet
Really Scaling Rails Notes:
(Alex Payne)
Setup:
•
o Big IP -> Apache mod_proxy_balancer -> Hundreds of Mongrels -> A big
ass MySQL DB
They setup mod_proxy to send only 1 request at a time to mongrels
•
If all their mongrels are taken users get an error page. (usually not good). At
•
some point you’ll have scaled out to know how many request you can get and
have enough mongrels to serve that volumn.
They use Benchmark.measure to calculate the runtime for any action.
•
The show_runtime shows the amount of time spent in DB, time spent in rendering
•
etc.
Shows an HTML comment at the end of each Twitter page. Easy to narrow
•
bottlenecks.
Never over-architect. Easy to want to tackle scaling problems early when they
•
don’t matter.
You need a community first in order to scale.
•
You need to abstract long running processes to Daemons.
•
Use Queuing to send instructions from Mongrel to Daemon.
•
They wrote a distributed queuing system called “Starling”
•
o Speaks to memcache language
o Transactional playback
o Fast, simple, 100% pure ruby
o They might release it (Twitter). Hope to open-source it within the month
(Oct 2007)
DB 101 –
•
o Index everything you query on (if there is a WHERE)
o Avoid complex joins
Cache Cache Cache
•
Use Monit to kill processes if they get too big.
•
Scale where it matters, obviously. Find where the users need to spend their time.
•
7. They use Munin, Nagios. They loves graphs, graphs are great.
•
Use the community. Create and API
•
They use EDGE Rails (using Piston).
•
Memcache roundtrip time is about 20ms.
•
Actively expire memcache, not general sweepers.
•
They use pure Ruby mem-cache. No fragment caching.
•
No DB Connection Pooling
•
1 Big master DB. 3 slaves: 1 slave for SolR Search, 1 for stats aggregations. 1 for
•
hot-backup.
About to partition their DB into shards based on content.
•
Rubinus Notes:
Is a Virtual Machine.
•
Brand new code base. Written in C/Ruby. No patches.
•
Nov 3: 1.0 preview. End of 2007 1.0
•
Fairly backwards-compatible.
•
Much better memory usage. Works to relieve memory leak pain. Garbage
•
collector is new and very simple.
Addresses the forking problem. i.e: Having lots of Mongrel processes. Handles
•
children better.
Works with the OS so that forked children share data.
•
Rubinus doesn’t run Mongrel yet.
•
You can pre-compile your projects. Somewhat obfuscate code.
•
Doesn’t use any existing Ruby 1.8 code.
•
When Ruby 1.9 comes out, they’ll be able to commit in a majority of the features.
•
Improves on Error Reporting. – Very flexible. Completely override backtrace.
•
Leaves the door open for many performance improvements after 1.0. inline-
•
caching, pre-compiling code, JIT (eventually) etc.
When C-extensions misbehave it brings the whole Ruby VM down.
•
Improves on Profiles to do performance testing of Ruby/Rails apps. In Ruby 1.8 it
•
gives a big performance hit.
In Rubinius they built in a sampling profiler and has little performance hit. Almost
•
no impact on runtime.
Rubinus vs Yarv (Ruby 1.9): trying to avoid this. BUT… Not much progression
•
with YARV. Been promised for 3 years now.
JRuby share the same RSpecs. IronRuby doesn’t to their knowledge. Yarv isn’t
•
either to their knowledge.
Communicating with Ruby Core is VERY difficult.
•
Rubinius is faster now in MRI(Ruby 1.8) in many micro-benchmarks.
•
8. They have no windows developers yet, actively seeking.
•
(ephoenix@engineyard.com)
You can run multiple VM’s in the same process.
•
You can embed it fairly easy. No shared data in the C part of it.
•
Currently has a green thread model.
•
You have access to low-level syntax tree as well.
•
100% compatible with existing C extensions. They have a layer called “sub-10”
•
to do this.
Ruby on Rails Best Practices Notes:
(Marcel Molina Jr, Michael Koziarski) www.therailsway.com
Controller with more than 6 or 7 actions with more than 6 or 7 lines each, you’re
doing something wrong.
Huge actions in Controllers not so good. Common Rails app problem.
Think of controllers as moderators to the people speaking (in this case the
Models). Do whatever you can in the Model.
Strive for the very “Skinny Controller” and very “Fat Models”
Try to create custom finders in the model instead of inline Model Finds in the
controllers. Make them reusable.
Every line of code in a method should be AT THE SAME LEVEL OF
ABSTRATION – Keep low level details out of controller methods, keep it at a
high level of abstraction.
Use “Model.association.find/create etc” instead of individual Finds for different
models that are related and have associations. AR Magic, use it.
Custom, re-usable finds are your friend.
In models, you’ll want to “extract” functions into higher level, clearly named
methods. Easier to understand than parsing the actual login. Call method instead
of writing the specific logic. It is also re-usable. Gives clarity of thought and is
more simplified. You keep a smaller buffer of things to remember after parsing
specific pieces of logic.
:with_scope is usually not needed, 9 times out of 10. They will make it harder to
use in Rails 2.0
Though :with_scope looks cool and easy to use at first, it makes things very hard
to understand what is going on when things get bigger. Makes it hard for new
developers to pick up off the code, you’re being “Too Clever.”
9. Building Rich Internet Applications with Flex and Ruby
on Rails Notes:
build advanced UI’s using flex.
RIA’s = Rich Internet Applications
2 methods: DTHML & Ajax and Plugin based (Flash, Silverlight etc)
Flex based off Flash Player 9 and Actionscript 3. New VM in Flash 9
Flex is a programming language. Based off NXML and Actionscript. Uses Swif.
Flex 3 coming out.
AVM2 (new VM in Flash 9) built for new rich apps. Aimed at performance and
speed. Supports full runtime error reporting, built-in debugging, binary socket
support. Also backwards compatible with AVM1 for backwards compatibility.
Old apps based on AVM1 (Written in Actionscript 2) running in AVM2 (Written
in Actionscript 3) also get speed benefits.
AVN2 is open-sourced to Mozilla. Will be built into Firefox 4 (JS2, modified
version of Actionscript). Tamarin Project.
AS3 fully OO programming scripting language.
Flex SDK cross-platform dev framework. Flex 3 SDK will be opened-sourced.
YouTube uses Flex. Mixbook is a Flex app (uses Rails as a backend).
Buzzword an online word processor built in Flex. Very dynamic and fluid UI.
Yahoo local mapping engine is done in Flex 2
Connecting Rails to Flex, 3 components in the SDK
o HTTPService
Little requirements
Widest variety of connection options
Offers little in options of data return, doesn’t offer much control.
Allows you to connect to RESTful interfaces.
Use XML as an interface. Respond_to – Feed that from Rails to
Flex.
FlexBuilder for Eclipse is a great plugin as a Flex IDE.
Binding in Flex is handled in the framework.
Basically use REST calls from Flex and put/manipulate the info
WITHIN the Flex UI.
Converts XML into Actionscript Objects within Flex
Downside:
o RPC Object
Use SOAP based XML wrappers.
Publish in WSDL
o RemoteObject Component (Best option)
Client side component
Standard requests over http and https
Packaged like SOAP but descriptors are binary
10. • Smaller Data Payload
• Faster Net Transfer
• Typed Object
Requires Flash Remoting Gateway on Server
• Server Side Endpoint for Communications
• Implemented in many languages
• Uses SSI – Java, CF, Ruby, Rails, PHP and .NET
WebORB for Rails is a good Rails plugin for using RemoteObject
to integrate Flex and Rails. By “Midnight Coders”. Written by Java
guys, made like a java app.
WebORB uses AMF for data transfer.
WebORB lets you communicate between Rails/Flex like one app.
RubyAMF is also good. Open Source, 1 developer. Rubyamf.org
• RubyAMF, same features as WebORB but 20-30%
FASTER
• Can be used with or without Rails
• MIT License
• Uses respond_to in controllers to specify correct response
format.
• Installed as a plugin.
Flex.org – For Ruby Developers. Lots of tutorials / Docs.
simeon@simb.net - Simeon Bateman
blog.simb.net
simb.net/blog (older none-migrated content.
Creating Hybrid Web + Desktop Apps with Rails and
SlingShot:
Allows full sync with desktop version
Removes latency of Internet, duh.
Distributes processing to the edge of the network (users computer, ala Flash)
Advanced Sync with peer to peer serviing. Even create “micro-lands” on an
application level.
No address bar, no backbutton.
Open Source.
SlingShot:
o Mac + PC Desktop app
o Rails Plugin
o Ruby + Mongrel Runtime
o Set of conventions
o GPLv2 open sourced
11. Sync DB + Filesystem
Use same code online + offline.
Drag + Drop functionality.
Competitors:
o Silverlight
o Adobe Flex
o Google Gears
o Firefox 3
o Custom desktop app + REST API
Architecture:
o Client side Rails Server. Communicates with your servers via XML/HTTP
o You package your app in the SlingShot container. Need to be ok with
showing your code.
Radient CMS has a slingshot version. (interesting)
Syncs at the DB level. Uses SQLite3 locally
Provides hooks to write your own sync code
You need to use Rails Ruby Wrappers for SQL.
Need to have created_at and updated_at are added to the models you want to
sync.
D/L Dragging out of the browser only works in OS X at the moment
SlingShot Doesn’t:
o Sync conflict resolution –
o Encrypt data
o Domain-specific on/offline issues
o Package your app automatically
o Update yourself + Rails app code
Development Case Study: MindMeister
Online Mind Mapping Programming.
Lots of Ajax/JS. Nice interface.
Easy to collaborate, share and use with others.
iPhone interface
Started in 2006 Had idea. Prototype and Started implementation in mid 2006.
Went live May 2007 – 1 Month, 30,000 users.
Based on HTML/ CSS / JavaScript / Ajax only. Enabled real-time collab (with
effects).
Choosing name took 6 months.
Private BETA start in Feb 2007. Lots of benefits.
Freemium model as well.
Feb 2007 had their 1000th user. Lots of traffic from Delicious.
12. March 2007 – Lots of competitors started coming up. 6-8. Helped to be first.
1-2% premium user rate. (1,500) as of Sept 2007. (1 month later).
Lessons learned:
o Kept it simple. Better design and usability.
o Spent lots on euros and it was worth it.
o Use a GREAT designer.
o Target non-technical users.
With share functionality they went through many iterations
Marketing:
o Write to bloggers
o UI – Spent lots on this.
o Post to app portals.
o Create an API.
o Write regular newsletters and blog posts.
o Add to delicious button
o SEO
o Be generous with Premium accounts
o Don’t do:
Comment spam
Didn’t try to pay for ads / placements
o Carefully select premium features
o Keep “sharing” features free
o Announce maintenance windows, be transparent. Explain outages and be
honest.
o Be responsive with support requests.
Use CC base subscription. Use wirecard for processing.
Use prototype and scriptaculous for all JS, lots of customization.
In the beginning just 2 people. Now they have 3 developers plus the 2 founders.
Yearly subscriptions. Don’t currently deal with CC rejections
Use Ajax to poll back to the server every 5 seconds.
Outsourcing to Open-source:
Toby, from Germany. Shopify founder and Rails-Core member.
Created liquid. A fluid and safe template language.
Also made ActiveMerchant – Ruby Gateway API for CC / Payment Processing
2 OpenBSD poxes. Debian cluster from Nginx -> HA Proxy -> Mongrel
Use Solr for search.
25,000 shopify stores. All indexed by spiders and public facing
Use memcache, works great.