serve like a boss (part one)
TRANSCRIPT
SERVE LIKE A BOSS (PART ONE)SOME CONCEPTS AND AN INTRODUCTION TO SERVER CONFIGURATION
27 Aug 2015
Hamed Nemati
SPOF (SINGLE POINT OF FAILURE)
• Hardware/Software interface• It’s failure will cause whole
system fail
ROUND-ROBIN SCHEDULING
• No priority• Simple• Starvation-free
Usage:• Process and network scheduler• data packet scheduling
“Each person takes an equal share of something in turn”
CACHE EVERYWHERE!
When:• Response time counts• Accessing multiple times
(Heavy reads, light writes)
“Ram is the new disk”
CACHE EVERYWHERE!
Cache hit occurs when the requested data can be found in a cache, while a cache miss occurs when it cannot.
BOTTLENECK
A bottleneck occurs when the capacity of an application or a computer system is severely limited by a single component.• Processor• Communication link• Disk IO
DATABASE CACHING
• Performance• Availability: by continued service for applications that depend
only on cached tables even if the backend server is unavailable.• Scalability• Flexibility
TWO CACHING SOFTWARE
• Key / Value• Up to 512MiB per Key• Support data types• Not only a cache mechanism• Can perform persistence
• Simple Key / Value [String]• Up to 1MiB per Key• Faster than Redis• Non-persistence
Use case:
User sessions caching
Use case:
Database caching
A SIMPLE REAL LIFE WEB ARCHITECTURE
User Request
Web Serve
r
Web App
Database Cache ( Memcached )
Database ( MySql )
Server
Sessions Cache (Redis)
CONFIGURING A WEB SERVER
OPERATING SYSTEM
• Use Ubuntu when you have more ram (otherwise CentOS fit better)• Use 32bit when you have less
ram• Most of the time newer versions
of the OS require more initial ram
• Always try to install packages from OS repositories:• Easy to update• More stable and reliable• More compatible with other
apps
OPERATING SYSTEM CHALLENGES
• Configuring different distributions are different• Configuring a 32bit OS may differ by it’s 64bit version• Configuring different versions of a same distribution may
differ
OPERATING SYSTEM CHALLENGES
Challenge: Distribution support has finished and packages are not maintained any more, so you can not find a package or the package is out dated
Solution: Use an external repository to get the latest [or your preferred] version of the package (Like Remi and EPEL for CentOS).
- Dedicated to my friends in NIGS
TO BE CONTINUED…
HAMED [email protected]@hamednz
New Idea Game Studio