High Performance Computing

ข่าวนี้เก่าไปหลายเดือน แต่น่าจะเป็นประโยชน์สำหรับคนที่อยากรู้ว่าบริการยอดฮิตอย่าง Instagram สามารถรองรับโหลดปริมาณมหาศาลจากผู้ใช้ทั่วโลกได้อย่างไร

เรื่องนี้มีอธิบายไว้ในบล็อก Instagram Engineering

เซิร์ฟเวอร์

  • Instagram ใช้เซิร์ฟเวอร์เสมือน คือเช่าบริการ Amazon EC2 ทั้งหมด ด้วยเหตุผลว่าปริมาณวิศวกรที่มี ไม่พอสำหรับการตั้งเซิร์ฟเวอร์เอง ดังนั้นเลือกเช่าใช้งาน EC2 ง่ายกว่า
  • ระบบปฏิบัติการเซิร์ฟเวอร์เป็น Ubuntu 11.04 โดยทีมงานบอกว่า Ubuntu รุ่นก่อนๆ มีปัญหากับ EC2 แต่ในรุ่นนี้ไม่มีแล้ว

Load Balancing

  • เดิมที Instagram ใช้เซิร์ฟเวอร์ NGINX สองตัว สลับกันแบบ DNS Round-Robin
  • ภายหลังเปลี่ยนมาใช้ Amazon Elastic Load Balancer (ELB), NGINX 3 instance สำหรับทำ load balancer
  • ใช้เทคนิคตัดการเชื่อมต่อแบบ SSL ที่ตัว ELB เพื่อลดโหลดของ NGINX
  • ใช้ Amazon Route53 สำหรับ DNS

Application Servers

  • ใช้ Django เป็น application server (ภาษา Python)
  • เครื่องที่รันเป็นเครื่องรองรับโหลดหนักพิเศษของ EC2 คือรุ่น High-CPU Extra-Large (ข้อมูลเมื่อ 4 เดือนก่อน ใช้ 25 instance)
  • ลักษณะงานของ Instagram เน้นซีพียูมากกว่าแรม จึงเลือกรุ่น High-CPU Extra-Large
  • ใช้ Green Unicorn สำหรับเซิร์ฟเวอร์ WSGI ของ Python (เดิมทีใช้ Apache + mod_wsgi แต่เปลืองพลังซีพียูมากไป
  • ใช้ Fabric สำหรับงานต่างๆ บนคอมมานด์ไลน์

Data storage

  • ข้อมูลส่วนใหญ่เก็บใน PostgreSQL
  • เครื่องที่ใช้รันฐานข้อมูลเป็นรุ่น Quadruple Extra-Large memory จำนวน 12 instance
  • งานเกือบทั้งหมดรันบนหน่วยความจำตลอดเวลา เพื่อประสิทธิภาพที่ดี เพราะระบบการเก็บข้อมูลบนดิสก์ของ Amazon ตอบสนองช้าเกินไป
  • ระบบไฟล์ของเครื่องที่ใช้ทำฐานข้อมูล เป็น XFS
  • เครื่องที่รัน PostgreSQL ทุกเครื่องจะต่อแบบ master-replica โดยใช้ Streaming Replication
  • รูปภาพทั้งหมดเก็บอยู่บน Amazon S3
  • ใช้ Amazon CloudFront เป็น CDN ช่วยกระจายโหลดรูปภาพ
  • ใช้ Redis สำหรับข้อมูล feed ทุกประเภท งานรันอยู่บนหน่วยความจำทั้งหมด ใช้เครื่อง Quadruple Extra-Large Memory สำหรับ Redis เช่นกัน
  • งานด้าน geolocation เดิมทีค้นที่ระดับ PostgreSQL แต่เปลี่ยนมาใช้ Apache Solr ในภายหลัง
  • ใช้ Memcached จำนวน 6 instance สำหรับแคช

Task Queue & Push Notifications

  • Gearman สำหรับการจัดคิวงานแบบ asynchronous (งานพวกอัพรูปไปยัง social network จะรันอยู่เบื้องหลังผ่านระบบคิวงานนี้ แยกจากการอัพไฟล์รูป)
  • pyapns สำหรับ push notification

Monitoring

  • Munin สำหรับตรวจสอบสถานะการทำงานของโพรเซส
  • ใช้ Pingdom ช่วยตรวจสอบโพรเซสจากภายนอกอีกชั้นหนึ่ง

รายละเอียดแบบเต็มๆ อ่านได้จาก What Powers Instagram: Hundreds of Instances, Dozens of Technologies

นอกจากนี้ยังมีบล็อกอีกตอนคือ Keeping Instagram up with over a million new users in twelve hours ที่อธิบายว่า Instagram รองรับโหลดที่เพิ่มขึ้นจากเวอร์ชัน Android ได้อย่างไร

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand

เหมือนเคยได้ยินว่า molome ก็ใช้ Amazon EC2 แต่ไม่รู้รายละเอียด
คิดอีกมุมหนึ่ง Amazon มีตลาด server ที่ดูดีกว่า 2เจ้าใหญ่อีกนะ

web นอกพวกนั้น ต้องมาดูงานที่บ้านเราน่ะฮะ
เครื่องประกอบ ไม่ถึง 10k เปิดทิ้งได้เป็นปี คนดูแลวุฒิแค่ ปวส โครตเทพ!!!

เห็นเป็นแบบนี้หลายเจ้านะครับไม่เจาะจง ...

EBS ของ Amazon เป็น XFS หนะ ถ้าเราไปใช้อย่างอื่น จะมีปัญหาเรื่อง File Consistency ตอน Restore ข้อมูล

ดังนั้น Service ใหญ่ๆที่จำเป็นต้องยิง Snapshot เรื่อยๆ XFS เป็นสิ่งที่ "ต้อง" ทำเลยหละบน Amazon AWS

Scale ดีมากเลยนะ ตอนเปิดเวอร์ชัน Android นี่ก็ลื่นมาก ทั้งที่มีคนสมัครใหม่หลายล้าน

iStyle Sat, 14/04/2012 - 00:59

เซิร์ฟเวอร์ น่าจะใช้ภาษาอังกฤษให้เข้าชุดกับกัวข้ออันอื่น ยิ่งมันเด้งไปอยู่ข้าง thumbnail แล้วมองไม่เหมือนหัวข้อไปใหญ่ = ='