Breaking the Code : A Guide to WhatsApp Business API.pdf
Serve like a boss (part one)
1. SERVE LIKE A BOSS (PART ONE)
SOME CONCEPTS AND AN INTRODUCTION TO SERVER CONFIGURATION
27 Aug 2015
Hamed Nemati
2. SPOF (SINGLE POINT OF FAILURE)
• Hardware/Software interface
• It’s failure will cause whole
system fail
3. 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”
5. CACHE EVERYWHERE!
Cache hit occurs when the
requested data can be found in
a cache, while a cache miss
occurs when it cannot.
6. 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
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 REAL LIFE WEB ARCHITECTURE
User
Request
Web
Server
Web App
Database Cache ( Memcached )
Database ( MySql )
Server
Sessions
Cache
(Redis)
11. 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
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).