SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Silt: Lessons Learned in a Smalltalk Web Deployment
Wednesday, September 6, 2006
How to Scale a Smalltalk Server
Without Any Planning
James A. Robertson
Product Manager
Smalltalk
Cincom Systems, Inc.
Agenda
• The Server: Basic Architecture
• A Few problems
• Summary
Project Discussed
• Silt
– http://www.cincomsmalltalk.com/CincomSmalltalkWik
i/Silt
– http://www.cincomsmalltalk.com/blog/blogView
• Managed in the public Store
– Silt is public domain
Architecture
BlogSaver
CacheManager StorageManager
Architecture
• BlogSaver
– The “ well known” API point for the server
– Originally, it was the entire server
– It still has way too much code in it 
– One instance per blog
Architecture
• StorageManager
– Manages the storage and retrieval of posts
– Extracted out of the BlogSaver class
– One serialized object file per day
– Posts (and their comments) are in a collection in that
object file
Architecture
• CacheManager
– Holds cache for the server
• Entire main page
• Last N individual posts asked for
• Keyword search cache
• Category search cache
• Dictionary of posts by year
– Older posts are less likely to change
Architecture
• Initially, BlogSaver was it
– Singleton
– Assumed a single blog
– Lots of references to it in the servlets, etc.
Problems
• First problem: Multiple Blogs
– I had set up the ability to have multiple posters
– I had not set up for multiple blogs
– Michael Lucas-Smith broached the subject
• I think he thought the delay was legal
• It was actually inertia – I didn’ t want to do the work!
Problems
Smalltalk.Blog defineClass: #AbstractBlogSaver
superclass: #{Core.Object}
indexedType: #none
private: false
instanceVariableNames: 'users settings ipFileSem settingsFile
syndicationSem '
classInstanceVariableNames: 'default '
imports: ''
category: 'Blog‘
Key was the “ default” class instance variable
Problems
• BlogSaver named: ‘ someName’ .
– The class instance variable holds a dictionary of blog
instances
– Those are created from configuration files
– Allowed me to set up multiple blogs
– There are now 24 active blogs, and a few inactive
ones
– Could easily add new Smalltalk servers and
segregate by blog
Problems
• Second Problem: Dynamic Request
Backup
– Posts are stored “ one file per day, all posts in that
file”
– To get the last few posts, every request ended up
reading the same files repeatedly
Problems
• Solution: Added a simple cache of all the
posts that belong on the front page
– New requests simply return the cached data
– Cleared out on updates to relevant posts, or on new
posts
– Immediately made the blog more responsive
Problems
• Third Problem: Slow Category Searches
– Each post can have a category
– Category searches required a scan of all posts
– Fine at first, but… I’ ve been at this since 2002
Problems
• Solution: A simple cache
– This is when I split out the CacheManager class
– One per blog
– Holds a Dictionary, where the keys are the categories, and the
values are the set of files containing matching posts
– One time hit to populate, updated on each new post or update
– Cache is saved to disk, so it does not need to be recreated at
startup
Problems
• Speeded up category searches
tremendously
– Only have to open matching files
– Linear search for matching posts in files
– “ fast enough”
– Considering Ajax for caching large result sets
Problems
• Fourth Problem: Keyword Searches
– Same problem as category searches, but cannot do
full up front cache
– Built same solution
– Cache the results as they get queried
– Still wasn’ t fast enough
Problems
• The issue: Scanning all blog posts in the
process that got kicked off by the servlet
– Runs at same priority as other queries
– Bogged the server down with I/O and CPU demands
Problems
• Solution: Class Promise
– Blogged: http://
www.cincomsmalltalk.com/blog/blogView?showComments
=true&entry=3307882025
Problems
• Original Code:
allResults := self actuallySearchFor: searchText
inTitle: searchInTitle
inText: searchInText.
^allResults asSortedCollection: [:a :b | a timestamp > b timestamp].
• New Code:
promise := [self actuallySearchFor: searchText
inTitle: searchInTitle
inText: searchInText] promiseAt: Processor
userBackgroundPriority.
allResults := promise value.
^allResults asSortedCollection: [:a :b | a timestamp > b timestamp].
Problems
• The Promise executes in the background,
and the asking thread waits as it executes
• Allows other server threads to execute
• Extended Back to Category searches
• As with Category searches, considering
an Ajax solution
Problems
• Still expensive: reading all posts takes
time
• Added a cache for posts, keyed to year
– Older posts unlikely to change
– Flush cache for year on change
– Makes searches much faster
Problems
• Fifth Problem: Spam
– Comments
– Trackbacks
– Referers
Problems
• In the server, comments and trackbacks
are handled the same way – i.e., solve
one, solve both
• Referers are gleaned from the server logs
Problems
• Comments/Trackbacks
– Turned off comments on posts off the front page
– Added a “ no more than N hrefs” rule for comments
– Added an IP throttle
• These steps mostly ended comment spam
• Turned off Trackback – it’ s a spam garden
Problems
• Referer Spam
– Bogus referrals from porn/pharma/etc sites
– Added a constantly updated blacklist of keywords
– List is updated every few hours
Problems
• The referral scanner was eating the
server!
– Executing the scan over the logs for each of the
blogs was wasteful
– Unified the scan
– Still ate too much time
– Ended up extracting the process from the server, set
it up as a CRON job
– The blog instances just look for (and cache) the
referral file every few hours
Summary
Summary
• I only solved these problems as they
came up
– I had no idea that they would be problems ahead of
time
• I patch the server live
– Update the code on the fly, including shape changes
to classes.
Summary
• I’ ve yet to hit a problem that wasn’ t my
fault
• Smalltalk is a powerful, scalable solution
for web applications
Contact Info
• James Robertson
– Jarober@gmail.com
– Jrobertson@cincom.com
• Silt
– http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Silt
• BottomFeeder
– http://www.cincomsmalltalk.com/BottomFeeder

Weitere ähnliche Inhalte

Was ist angesagt?

Widening your JavaScript Application
Widening your JavaScript ApplicationWidening your JavaScript Application
Widening your JavaScript Application
Alex McPherson
 

Was ist angesagt? (20)

Saving Time By Testing With Jest
Saving Time By Testing With JestSaving Time By Testing With Jest
Saving Time By Testing With Jest
 
Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017
 
Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?
 
Selenium
SeleniumSelenium
Selenium
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
 
Trying Out Tomorrow’s WordPress Today
Trying Out Tomorrow’s WordPress TodayTrying Out Tomorrow’s WordPress Today
Trying Out Tomorrow’s WordPress Today
 
Introduction to jest
Introduction to jestIntroduction to jest
Introduction to jest
 
Bccon use notes objects in memory and other useful
Bccon   use notes objects in memory and other usefulBccon   use notes objects in memory and other useful
Bccon use notes objects in memory and other useful
 
Laravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consLaravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & cons
 
Using REST with VSTS and TFS
Using REST with VSTS and TFSUsing REST with VSTS and TFS
Using REST with VSTS and TFS
 
A brief intro to nodejs
A brief intro to nodejsA brief intro to nodejs
A brief intro to nodejs
 
Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
 
Widening your JavaScript Application
Widening your JavaScript ApplicationWidening your JavaScript Application
Widening your JavaScript Application
 
2014 SpiceWorld London Breakout
2014 SpiceWorld London Breakout2014 SpiceWorld London Breakout
2014 SpiceWorld London Breakout
 
IBM Connections Troubleshooting or “Get the Cow off the Ice”
IBM Connections Troubleshooting or “Get the Cow off the Ice” IBM Connections Troubleshooting or “Get the Cow off the Ice”
IBM Connections Troubleshooting or “Get the Cow off the Ice”
 
Best and worst practices deploying IBM Connections
Best and worst practices deploying IBM ConnectionsBest and worst practices deploying IBM Connections
Best and worst practices deploying IBM Connections
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Coding with jetpack
Coding with jetpackCoding with jetpack
Coding with jetpack
 

Andere mochten auch

Investigating the impact of silt on habitat
Investigating the impact of silt on habitatInvestigating the impact of silt on habitat
Investigating the impact of silt on habitat
learningfforlife
 
Rocks And Sand Earth Science Lesson Portfolio
Rocks And Sand Earth Science Lesson PortfolioRocks And Sand Earth Science Lesson Portfolio
Rocks And Sand Earth Science Lesson Portfolio
oliviaioannou
 
Biosphere : Sand Dune Succession
Biosphere : Sand Dune SuccessionBiosphere : Sand Dune Succession
Biosphere : Sand Dune Succession
ValVannet
 
Coastal Protection Methods
Coastal Protection MethodsCoastal Protection Methods
Coastal Protection Methods
guesta38fc29
 

Andere mochten auch (13)

SBNWR Sediment Augmentation Lessons Learned
SBNWR Sediment Augmentation Lessons LearnedSBNWR Sediment Augmentation Lessons Learned
SBNWR Sediment Augmentation Lessons Learned
 
Fase 1
Fase 1Fase 1
Fase 1
 
Investigating the impact of silt on habitat
Investigating the impact of silt on habitatInvestigating the impact of silt on habitat
Investigating the impact of silt on habitat
 
Rocks And Sand Earth Science Lesson Portfolio
Rocks And Sand Earth Science Lesson PortfolioRocks And Sand Earth Science Lesson Portfolio
Rocks And Sand Earth Science Lesson Portfolio
 
Kajaria Gres Tough
Kajaria Gres ToughKajaria Gres Tough
Kajaria Gres Tough
 
(classification of soil)
(classification of soil)(classification of soil)
(classification of soil)
 
Classification of soil
Classification of soilClassification of soil
Classification of soil
 
Properties of soils (teach)
Properties of soils (teach) Properties of soils (teach)
Properties of soils (teach)
 
Sand Dune Ecosystems
Sand Dune EcosystemsSand Dune Ecosystems
Sand Dune Ecosystems
 
Biosphere : Sand Dune Succession
Biosphere : Sand Dune SuccessionBiosphere : Sand Dune Succession
Biosphere : Sand Dune Succession
 
types of soil
types of soiltypes of soil
types of soil
 
Coastal Protection Methods
Coastal Protection MethodsCoastal Protection Methods
Coastal Protection Methods
 
Detailed Lesson Plan (ENGLISH, MATH, SCIENCE, FILIPINO)
Detailed Lesson Plan (ENGLISH, MATH, SCIENCE, FILIPINO)Detailed Lesson Plan (ENGLISH, MATH, SCIENCE, FILIPINO)
Detailed Lesson Plan (ENGLISH, MATH, SCIENCE, FILIPINO)
 

Ähnlich wie Silt: Lessons Learned

How to get your theme in WordPress
How to get your theme in WordPressHow to get your theme in WordPress
How to get your theme in WordPress
Nisha Singh
 

Ähnlich wie Silt: Lessons Learned (20)

How to write test in node.js
How to write test in node.jsHow to write test in node.js
How to write test in node.js
 
WordPress Meetup Bandung - December 2014
WordPress Meetup Bandung - December 2014WordPress Meetup Bandung - December 2014
WordPress Meetup Bandung - December 2014
 
BACKFiL Finding Files you left on the server
BACKFiL Finding Files you left on the serverBACKFiL Finding Files you left on the server
BACKFiL Finding Files you left on the server
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)
 
BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...
BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...
BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's New
 
full-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptxfull-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptx
 
Acing the Elastic Certified Engineer Exam
Acing the Elastic Certified Engineer ExamAcing the Elastic Certified Engineer Exam
Acing the Elastic Certified Engineer Exam
 
Movingto moodle2 v1 1
Movingto moodle2 v1 1Movingto moodle2 v1 1
Movingto moodle2 v1 1
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomaven
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
 
SOA with PHP and Symfony
SOA with PHP and SymfonySOA with PHP and Symfony
SOA with PHP and Symfony
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
WordPress - fixing sites with problems
WordPress - fixing sites with problemsWordPress - fixing sites with problems
WordPress - fixing sites with problems
 
WordPress Intermediate Workshop
WordPress Intermediate WorkshopWordPress Intermediate Workshop
WordPress Intermediate Workshop
 
How to get your theme in WordPress
How to get your theme in WordPressHow to get your theme in WordPress
How to get your theme in WordPress
 
Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017
Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017
Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017
 

Mehr von ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

Mehr von ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Silt: Lessons Learned

  • 2. How to Scale a Smalltalk Server Without Any Planning James A. Robertson Product Manager Smalltalk Cincom Systems, Inc.
  • 3. Agenda • The Server: Basic Architecture • A Few problems • Summary
  • 4. Project Discussed • Silt – http://www.cincomsmalltalk.com/CincomSmalltalkWik i/Silt – http://www.cincomsmalltalk.com/blog/blogView • Managed in the public Store – Silt is public domain
  • 6. Architecture • BlogSaver – The “ well known” API point for the server – Originally, it was the entire server – It still has way too much code in it  – One instance per blog
  • 7. Architecture • StorageManager – Manages the storage and retrieval of posts – Extracted out of the BlogSaver class – One serialized object file per day – Posts (and their comments) are in a collection in that object file
  • 8. Architecture • CacheManager – Holds cache for the server • Entire main page • Last N individual posts asked for • Keyword search cache • Category search cache • Dictionary of posts by year – Older posts are less likely to change
  • 9. Architecture • Initially, BlogSaver was it – Singleton – Assumed a single blog – Lots of references to it in the servlets, etc.
  • 10. Problems • First problem: Multiple Blogs – I had set up the ability to have multiple posters – I had not set up for multiple blogs – Michael Lucas-Smith broached the subject • I think he thought the delay was legal • It was actually inertia – I didn’ t want to do the work!
  • 11. Problems Smalltalk.Blog defineClass: #AbstractBlogSaver superclass: #{Core.Object} indexedType: #none private: false instanceVariableNames: 'users settings ipFileSem settingsFile syndicationSem ' classInstanceVariableNames: 'default ' imports: '' category: 'Blog‘ Key was the “ default” class instance variable
  • 12. Problems • BlogSaver named: ‘ someName’ . – The class instance variable holds a dictionary of blog instances – Those are created from configuration files – Allowed me to set up multiple blogs – There are now 24 active blogs, and a few inactive ones – Could easily add new Smalltalk servers and segregate by blog
  • 13. Problems • Second Problem: Dynamic Request Backup – Posts are stored “ one file per day, all posts in that file” – To get the last few posts, every request ended up reading the same files repeatedly
  • 14. Problems • Solution: Added a simple cache of all the posts that belong on the front page – New requests simply return the cached data – Cleared out on updates to relevant posts, or on new posts – Immediately made the blog more responsive
  • 15. Problems • Third Problem: Slow Category Searches – Each post can have a category – Category searches required a scan of all posts – Fine at first, but… I’ ve been at this since 2002
  • 16. Problems • Solution: A simple cache – This is when I split out the CacheManager class – One per blog – Holds a Dictionary, where the keys are the categories, and the values are the set of files containing matching posts – One time hit to populate, updated on each new post or update – Cache is saved to disk, so it does not need to be recreated at startup
  • 17. Problems • Speeded up category searches tremendously – Only have to open matching files – Linear search for matching posts in files – “ fast enough” – Considering Ajax for caching large result sets
  • 18. Problems • Fourth Problem: Keyword Searches – Same problem as category searches, but cannot do full up front cache – Built same solution – Cache the results as they get queried – Still wasn’ t fast enough
  • 19. Problems • The issue: Scanning all blog posts in the process that got kicked off by the servlet – Runs at same priority as other queries – Bogged the server down with I/O and CPU demands
  • 20. Problems • Solution: Class Promise – Blogged: http:// www.cincomsmalltalk.com/blog/blogView?showComments =true&entry=3307882025
  • 21. Problems • Original Code: allResults := self actuallySearchFor: searchText inTitle: searchInTitle inText: searchInText. ^allResults asSortedCollection: [:a :b | a timestamp > b timestamp]. • New Code: promise := [self actuallySearchFor: searchText inTitle: searchInTitle inText: searchInText] promiseAt: Processor userBackgroundPriority. allResults := promise value. ^allResults asSortedCollection: [:a :b | a timestamp > b timestamp].
  • 22. Problems • The Promise executes in the background, and the asking thread waits as it executes • Allows other server threads to execute • Extended Back to Category searches • As with Category searches, considering an Ajax solution
  • 23. Problems • Still expensive: reading all posts takes time • Added a cache for posts, keyed to year – Older posts unlikely to change – Flush cache for year on change – Makes searches much faster
  • 24. Problems • Fifth Problem: Spam – Comments – Trackbacks – Referers
  • 25. Problems • In the server, comments and trackbacks are handled the same way – i.e., solve one, solve both • Referers are gleaned from the server logs
  • 26. Problems • Comments/Trackbacks – Turned off comments on posts off the front page – Added a “ no more than N hrefs” rule for comments – Added an IP throttle • These steps mostly ended comment spam • Turned off Trackback – it’ s a spam garden
  • 27. Problems • Referer Spam – Bogus referrals from porn/pharma/etc sites – Added a constantly updated blacklist of keywords – List is updated every few hours
  • 28. Problems • The referral scanner was eating the server! – Executing the scan over the logs for each of the blogs was wasteful – Unified the scan – Still ate too much time – Ended up extracting the process from the server, set it up as a CRON job – The blog instances just look for (and cache) the referral file every few hours
  • 30. Summary • I only solved these problems as they came up – I had no idea that they would be problems ahead of time • I patch the server live – Update the code on the fly, including shape changes to classes.
  • 31. Summary • I’ ve yet to hit a problem that wasn’ t my fault • Smalltalk is a powerful, scalable solution for web applications
  • 32. Contact Info • James Robertson – Jarober@gmail.com – Jrobertson@cincom.com • Silt – http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Silt • BottomFeeder – http://www.cincomsmalltalk.com/BottomFeeder