serve like a boss (part one)

15
SERVE LIKE A BOSS (PART ONE) SOME CONCEPTS AND AN INTRODUCTION TO SERVER CONFIGURATION 27 Aug 2015 Hamed Nemati

Upload: hamed-nemati

Post on 07-Jan-2017

37 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Serve like a boss (part one)

SERVE LIKE A BOSS (PART ONE)SOME CONCEPTS AND AN INTRODUCTION TO SERVER CONFIGURATION

27 Aug 2015

Hamed Nemati

Page 2: Serve like a boss (part one)

SPOF (SINGLE POINT OF FAILURE)

• Hardware/Software interface• It’s failure will cause whole

system fail

Page 3: Serve like a boss (part one)

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”

Page 4: Serve like a boss (part one)

CACHE EVERYWHERE!

When:• Response time counts• Accessing multiple times

(Heavy reads, light writes)

“Ram is the new disk”

Page 5: Serve like a boss (part one)

CACHE EVERYWHERE!

Cache hit occurs when the requested data can be found in a cache, while a cache miss occurs when it cannot.

Page 6: Serve like a boss (part one)

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

Page 7: Serve like a boss (part one)

DATABASE CACHING

• Performance• Availability: by continued service for applications that depend

only on cached tables even if the backend server is unavailable.• Scalability• Flexibility

Page 8: Serve like a boss (part one)

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

Page 9: Serve like a boss (part one)

A SIMPLE REAL LIFE WEB ARCHITECTURE

User Request

Web Serve

r

Web App

Database Cache ( Memcached )

Database ( MySql )

Server

Sessions Cache (Redis)

Page 10: Serve like a boss (part one)

CONFIGURING A WEB SERVER

Page 11: Serve like a boss (part one)

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

Page 12: Serve like a boss (part one)

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

Page 13: Serve like a boss (part one)

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).

Page 14: Serve like a boss (part one)

- Dedicated to my friends in NIGS

TO BE CONTINUED…