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
Server
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 NEMATI
• hamed@atbox.io
• @hamednz
• New Idea Game Studio

Serve like a boss (part one)

  • 1.
    SERVE LIKE ABOSS (PART ONE) SOME CONCEPTS AND AN INTRODUCTION TO SERVER CONFIGURATION 27 Aug 2015 Hamed Nemati
  • 2.
    SPOF (SINGLE POINTOF FAILURE) • Hardware/Software interface • It’s failure will cause whole system fail
  • 3.
    ROUND-ROBIN SCHEDULING • Nopriority • Simple • Starvation-free Usage: • Process and network scheduler • data packet scheduling “Each person takes an equal share of something in turn”
  • 4.
    CACHE EVERYWHERE! When: • Responsetime counts • Accessing multiple times (Heavy reads, light writes) “Ram is the new disk”
  • 5.
    CACHE EVERYWHERE! Cache hitoccurs when the requested data can be found in a cache, while a cache miss occurs when it cannot.
  • 6.
    BOTTLENECK A bottleneck occurswhen the capacity of an application or a computer system is severely limited by a single component. • Processor • Communication link • Disk IO
  • 7.
    DATABASE CACHING • Performance •Availability: by continued service for applications that depend only on cached tables even if the backend server is unavailable. • Scalability • Flexibility
  • 8.
    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
  • 9.
    A SIMPLE REALLIFE WEB ARCHITECTURE User Request Web Server Web App Database Cache ( Memcached ) Database ( MySql ) Server Sessions Cache (Redis)
  • 10.
  • 11.
    OPERATING SYSTEM • UseUbuntu 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
  • 12.
    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
  • 13.
    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).
  • 14.
    - Dedicated tomy friends in NIGS TO BE CONTINUED…
  • 15.
    HAMED NEMATI • hamed@atbox.io •@hamednz • New Idea Game Studio