The Underlying Technology of Messages

Facebook推出新版消息系统,整合聊天、短信、邮件等多种通讯方式。为支撑这一系统,Facebook团队花费一年时间建立了一个强大的基础设施,使用HBase替代原有的Cassandra和MySQL解决方案,解决了大量数据处理中的性能瓶颈。

转自Facebook技术博客【原文时间:2010/11/16】
原文链接

We’re launching a new version of Messages today that combines chat, SMS, email, and Messages into a real-time conversation. The product team spent the last year building out a robust, scalable infrastructure. As we launch the product, we wanted to share some details about the technology.

The current Messages infrastructure handles over 350 million users sending over 15 billion person-to-person messages per month. Our chat service supports over 300 million users who send over 120 billion messages per month. By monitoring usage, two general data patterns emerged:

A short set of temporal data that tends to be volatile
An ever-growing set of data that rarely gets accessed

When we started investigating a replacement for the existing Messages infrastructure, we wanted to take an objective approach to storage for these two usage patterns. In 2008 we open-sourced Cassandra, an eventual-consistency key-value store that was already in production serving traffic for Inbox Search. Our Operations and Databases teams have extensive knowledge in managing and running MySQL, so switching off of either technology was a serious concern. We either had to move away from our investment in Cassandra or train our Operations teams to support a new, large system.

We spent a few weeks setting up a test framework to evaluate clusters of MySQL, Apache Cassandra, Apache HBase, and a couple of other systems. We ultimately chose HBase. MySQL proved to not handle the long tail of data well; as indexes and data sets grew large, performance suffered. We found Cassandra’s eventual consistency model to be a difficult pattern to reconcile for our new Messages infrastructure.

HBase comes with very good scalability and performance for this workload and a simpler consistency model than Cassandra. While we’ve done a lot of work on HBase itself over the past year, when we started we also found it to be the most feature rich in terms of our requirements (auto load balancing and failover, compression support, multiple shards per server, etc.). HDFS, the underlying filesystem used by HBase, provides several nice features such as replication, end-to-end checksums, and automatic rebalancing. Additionally, our technical teams already had a lot of development and operational expertise in HDFS from data processing with Hadoop. Since we started working on HBase, we’ve been focused on committing our changes back to HBase itself and working closely with the community. The open source release of HBase is what we’re running today.

Since Messages accepts data from many sources such as email and SMS, we decided to write an application server from scratch instead of using our generic Web infrastructure to handle all decision making for a user’s messages. It interfaces with a large number of other services: we store attachments in Haystack, wrote a user discovery service on top of Apache ZooKeeper, and talk to other infrastructure services for email account verification, friend relationships, privacy decisions, and delivery decisions (for example, should a message be sent over chat or SMS). We spent a lot of time making sure each of these services are reliable, robust, and performant enough to handle a real-time messaging system.

The new Messages will launch over 20 new infrastructure services to ensure you have a great product experience. We hope you enjoy using it.

Kannan is a software engineer at Facebook.

Performance Endpoint for Linux (32-bit and 64-bit) File README Version 7.30 SP1 Copyright (C) 2003-2013 Ixia. All rights reserved. Ixia 26601 W. Agoura Road Calabasas, CA 91302 U.S.A. Web: www.ixiacom.com Phone: +1 818 871-1800 or + 1 877 FOR IXIA Fax: +1 818 871 1805 General information: Email: info@ixiacom.com Technical support: Email: support@ixiacom.com Thanks! We appreciate your interest in our software. We keep seeking ways to improve it; we welcome your feedback and suggestions. We continue to enhance and expand our Web site -- come and visit us. The latest versions of the endpoints are always available for free at http://www.ixiacom.com/support/endpoint_library/ Note that the Ixia Performance Endpoints have not been tested with NetIQ applications and may not function properly with NetIQ applications. Linux kernel 2.4.20 We've tested with packages that implement Linux kernel 2.4.20. We have not tested this version of Performance Endpoint with earlier versions of the Linux kernel. Only TCP and UDP/RTP support The Performance Endpoint for Linux uses the Sockets interface to the TCP/IP support shipped with Linux. IPX, SPX, or other network protocols are not supported in this version. For IPv6 support, kernel 2.4.18-3 or better is required. Here's what you need to run the endpoint program with Linux: - A computer capable of running Linux well. We recommend a CPU such as Intel Pentium III or better. For the 64-bit (x64) version of the endpoint you will need an AMD64/EM64T compatible CPU, such as AMD Opteron or an Intel Xeon with support for EM64T technology. For the 64-bit versions of the endpoint the corresponding 64-bit version of Linux is also required. - 64 MBytes of RAM. The total RAM requirement depends on RAM usage of the underlying protocol stack and the number of concurrent endpoint pairs. For tests involving over one hundred connections through a single endpoint, additional memory may be required. - A hard disk with at least 8 MBytes of space available. - Linux kernel 2.4.20 or better. Older versions of the Linux kernel may not support IPv6 properly. TAR-Based Endpoint Installation for Linux ------------------------------------------------------------------- Use the TAR-based installation if you are installing the endpoint on any Linux platform other than Red Hat (32-bit) or SuSE (64-bit). First, make sure that you are logged in as a "root" user. Also remember all commands and parameters discussed here are case-sensitive. Use the combination of uppercase and lowercase letters as shown below (for all the file names, "M" represents the major version and "m" represents the minor version). The following instructions describe how to install the endpoint on a computer with a CD-ROM drive. Put the CD-ROM in your CD-ROM drive. If you want to install the 64-bit version of the endpoint, replace the name of the archives (pelnx_Mm.tar.gz and pelnx_Mm.tar) from the following instructions with pelinux_amd64_Mm.tar.gz Enter the following commands, assuming your CD-ROM drive device name is /dev/cdrom and you are able to create a temporary directory named cdrom: mkdir /cdrom mount /dev/cdrom /cdrom The CD-ROM contains an archive of the endpoint package. First use the RM command to ensure a clean temporary install directory. Then use the TAR command to extract the archive contents from the CD-ROM: cd /tmp rm -fr temp tar -zxvf ./pelnx_Mm.tar.gz Next, run the endpoint's installation script to install the endpoint: ./endpoint.install The license agreement is shown, presented with the "more" command. Press the space bar until the end of the agreement is displayed. You are asked whether you accept the terms and conditions of the agreement. If you do, enter "accept_license" and press return. After the installation is complete, use the UMOUNT command to unmount the file system from the CD-ROM: umount /cdrom During installation, you will see several status messages. Pay close attention to the output. When the installation is successful, you see the message "Installation of endpoint was successful." The installation script and temporary directory are not removed automatically if the installation is successful. If you need the disk space after installing the endpoint, you may delete the temporary directory and installation script. Unattended Installation for TAR-Based Linux You can install the endpoint silently, that is, without providing any additional user input. Complete the steps, as described above, through the TAR command. Next, run the endpoint's installation, adding the "accept_license" parameter: ./endpoint.install accept_license Removing the TAR-Based Endpoint Package (Uninstall) You must be logged in as the root user to remove the endpoint package. If you need to remove the endpoint package from your hard disk, first stop the endpoint program (if running). Enter the following command: /usr/local/Ixia/endpoint -k Use the following command to remove the endpoint: /usr/local/Ixia/endpoint.remove If the removal is successful, you will see the following: "Removal of endpoint was successful." This removes the files from /usr/local/Ixia, except for any files added to this directory that were not present at install, such as the endpoint.ini file, but does not delete the directory. The remove program does not automatically delete files added to the directory that you may need if you reinstall the product. RPM-Based Endpoint Installation for Linux ------------------------------------------------------------------- Use the RPM-based installation if you are installing the endpoint on Red Hat (32-bit) or SuSE (64-bit). For installation, first make sure that you are logged in as a "root" user. Also remember all commands and parameters discussed here are case-sensitive. Use the combination of uppercase and lowercase letters as shown below (for all the file names, "M" represents the major version and "m" represents the minor version). The following instructions describe how to install the endpoint on a computer with a CD-ROM drive. Put the CD-ROM in your CD-ROM drive. If you want to install the 64-bit version of the endpoint, replace the name of the RPM file (pelnx_Mm.rpm) from the following instructions with pelinux_amd64_Mm.rpm Enter the following commands, assuming your CD-ROM drive device name is /dev/cdrom and you are able to create a temporary directory named cdrom: mkdir /cdrom mount /dev/cdrom /cdrom Copy the pelnx_Mm.rpm file from the CD-ROM drive to a local directory (for example, tmp). cp /cdrom/endpoint/linux/pelnx_Mm.rpm /tmp For RPM, use the RPM command to install the endpoint: rpm -Uvh /tmp/pelnx_Mm.rpm After the installation is complete, use the UMOUNT command to unmount the file system from the CD-ROM: umount /cdrom During installation, you will see several status messages. Pay close attention to the output. When the installation is successful, you see the message "Installation of endpoint was successful." Removing the RPM-Based Endpoint Package (Uninstall) You must be logged in as the root user to remove the endpoint package. If you need to remove the endpoint package from your hard disk, first stop the endpoint program (if running). Enter the following command: /usr/local/Ixia/endpoint -k Use the following command to remove the endpoint (you must be logged in as root to run this program): rpm -e endpoint If the removal is successful, you will see the following: "Removal of endpoint was successful." This removes the files from /usr/local/Ixia, except for any files that were added to this directory that were not present at install, such as the endpoint.ini file, and does not delete the directory. The remove program does not automatically delete files added to the directory that you may need if you reinstall the product. What We Do During Installation Here is what happens during the installation steps. The endpoint is installed into the directory /usr/local/Ixia. A directory is created with the following contents: - the executable programs. - the README file. - various install and uninstall programs. - the directory cmpfiles. This directory contains files with the .cmp file extension. These are files containing data of different types, such as typical text or binary data. These files are used by the endpoint as data on SEND commands. The different data types can be used to vary the data compression performance of your network hardware and software. - the file endpoint.ini. Our software ends any copy of the endpoint program currently running and starts a copy of the newly-installed endpoint. You can run tests immediately, without a reboot. Our software displays information on how to update your system to have the endpoint start automatically upon reboot. No changes are made to the PATH environment variable of the root user. *IxChariot is a registered trademark of Ixia. United States Patent Numbers 5,838,919, 5,881,237, 5,937,165, and 6,061,725. Other patents pending.啥意思
10-16
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值