Why BootDev — For website builders’ Backend as a service (wBaaS)

Recently, we launched a project, bootdev which deploys a configured Drupal site (Drucloud) into a pre given architecture into users’ personal AWS account. We call it website backend as a service (wBaaS). With this approach, we can deliver our hard earned experience to other business owner or developers without REWORK of what we did.

What we deliver is just configuration and knowledge. After the deployment, we dont host it, users’ host their site in their own AWS. We also provide a technical foundation / playground for people to add features /  experience best practice(s).

Currently available with Drupal 7.

With just 1 click, you can have pre configured like:

  • Caching
    • Nginx micro-cache
    • Cache pre-warmer
    • PHP APC
    • Memcache (AWS ElastiCache)
    • MySQL Query Cache
  • Database
    • AWS RDS configuration for Drupal
    • Multi-AZ
    • Secure by under AWS VPC
  • Web server
    • Nginx Drupal configuration
      • advagg css / js compression support
      • Image style catching
      • Micro cache
      • AWS Cloudfront CDN support (far future expire)
      • Cache control headers
    • PHP-FPM
      • APC
      • Max client configurations under EC2 m3.large
  • SOLR Search
    • SOLR index cron job
    • Drupal SOLR integration
  • DevOps
    • Cloudformation
    • Chef
    • Auto-scaling
    • Git deploy with bitbucket private repo + deploy key
  • Maintenance
    • System maintenance cron job
    • xmlsitemap
    • social network stat
  • Email
    • SPAM email control
    • Mass mail support (AWS SES support)
  • MAP
    • Google Map integration
  • Social
    • Social network meta-tag
  • File handling
    • Drupal S3 integration
    • Push to CDN
    • Separate file handling with other Drupal services
  • CDN
    • Drupal CDN configuration
    • Suport CORs
  • Server architecture
    • 2* EC2 m3.large web server
    • 1* EC2 m1.small chef server
    • 1* Mutli-AZ m3.large RDS
    • 1* EC2 m3.large SOLR server
    • 2* ElastiCache node m1.medium
    • Cloudfront CDN
    • Amazon S3
    • Auto-scaling with ELB
    • 2* EC2 m1.small GlusterFS
    • Inside VPC

In coming topics, I will explain why you need each of those configurations to make your site awesome.

recommend_package_datasheet(1)

淺談叢集式電腦 ( Clustering )

當你開始接觸 clustering 時就會發覺, 原來沒學 clustering 根本等於沒有學 Unix / Linux. 
我們一般情況用到的 SERVER / Client 只是皮毛. Clustering 一個字, 內裹包含了多種技術, 
以下例子是常用的
  1. HPC – High performance computing
  2. Server Load balancing 負載平衡
    1. DNS round robin
    2. LVS – ipvsadm
  3. HA – High availability
    1. XEN cluster
    2. Heartbeat
    3. DRBD - http://www.drbd.org/
  4. Parallel computing
    1. http://en.wikipedia.org/wiki/MPICH

今天所談的是入門級的 clustering, LVS

LVS – Linux virtual server主要是用作負載平衡 與 HA,

What is the Linux Virtual Server?

The Linux Virtual Server is a highly scalable and highly available server built on a cluster of real servers, with the load balancer running on the Linux operating system. The architecture of the server cluster is fully transparent to end users, and the users interact as if it were a single high-performance virtual server.

SOURCE: http://www.linuxvirtualserver.org/ 

負載平衡的意思是把一部服務器的工作分到多部服務器之上. 由一個服務器為主人 ( Master ), 其他為幫手 ( node ). 如下圖

more_on_clustering

更可以制定負載平衡的策略

詳程參考, http://linux.die.net/man/8/ipvsadm

    1. rr – Robin Robin: distributes jobs equally amongst the available real servers.
    2. wrr – Weighted Round Robin: assigns jobs to real servers proportionally to there real servers’ weight. Servers with higher weights receive new jobs first and get more jobs than servers with lower weights. Servers with equal weights get an equal distribution of new jobs.
    3. lc – Least-Connection: assigns more jobs to real servers with fewer active jobs.
    4. wlc – Weighted Least-Connection: assigns more jobs to servers with fewer jobs and relative to the real servers’ weight (Ci/Wi). This is the default.
    5. lblc – Locality-Based Least-Connection: assigns jobs destined for the same IP address to the same server if the server is not overloaded and available; otherwise assign jobs to servers with fewer jobs, and keep it for future assignment.
    6. lblcr – Locality-Based Least-Connection with Replication: assigns jobs destined for the same IP address to the least-connection node in the server set for the IP address. If all the node in the server set are over loaded, it picks up a node with fewer jobs in the cluster and adds it in the sever set for the target. If the server set has not been modified for the specified time, the most loaded node is removed from the server set, in order to avoid high degree of replication.
    7. dh – Destination Hashing: assigns jobs to servers through looking up a statically assigned hash table by their destination IP addresses.
    8. sh – Source Hashing: assigns jobs to servers through looking up a statically assigned hash table by their source IP addresses.
    9. sed – Shortest Expected Delay: assigns an incoming job to the server with the shortest expected delay. The expected delay that the job will experience is (Ci + 1) / Ui if sent to the ith server, in which Ci is the number of jobs on the the ith server and Ui is the fixed service rate (weight) of the ith server.
    10. nq – Never Queue: assigns an incoming job to an idle server if there is, instead of waiting for a fast one; if all the servers are busy, it adopts the Shortest Expected Delay policy to assign the job.

source: Man page of ipvsadm

負載平衡方法大致上有

  1. NAT (Network address translation)
  2. DR – direct routing
  3. Tunneling

以下是 LVS – NAT LOAD BALANCING 的參考

原意圖

VS-NAT

VS via NAT, source: http://www.linuxvirtualserver.org/VS-NAT.html

指令

Master (NAT)

echo 1 > /proc/sys/net/ipv4/ip_forward

ipvsadm -A -t 192.168.7.200:80 -s rr

ipvsadm -a -t 192.168.7.200:80 -r 192.168.7.201:80 -m

ipvsadm -a -t 192.168.7.200:80 -r 192.168.7.202:80 -m

ipvsadm -a -t 192.168.7.200:80 -r 192.168.7.203:80 -m

ipvsadm -L –stats (現時的連接情況)

Nodes:

Set default route to 192.168.7.200

route add default gw 192.168.7.000

ip 地址

名稱 意思
192.168.7.200 Master
192.168.7.201 Node
192.168.7.202 Node
192.168.7.203 Node
192.168.7.1 Default GW
80 Www – web 服務器的 port number
rr Round robin 策略
-m LVS NAT
-a ADD SERVER
-A ADD SERVICE

Thanks, 有興趣多討論請跟我連絡 keithyau@yubis.net !!