Business commit policy under high concurrency (RPM)

Source: Internet
Author: User

Source: http://www.cnblogs.com/bobsoft/p/3622691.html

Recently, considering the high concurrency of e-commerce platform, the problem of order Processing

Summarized as follows:

1. Most of the BS system's biggest performance bottlenecks I think we should be at database.

Why? Because of other influencing factors (network, storage, Web server ...) ), which can be solved by investing more quickly

Internet? Solve by increasing bandwidth; storage? Large capacity and reliability problems can be solved by storage device or area storage.

Web server? Can be resolved with four-layer or seven-layer load balancing.

2. The database is limited to insert, which is the "commit" or "save" as stated in the business

Why? Queries for data can be resolved through a cache cluster. Commit or save, the resulting db is write lock, is exclusive, and as the volume of data is large or concurrent high, the granularity of the lock, the length of the lock is larger, the problem is more serious.

3. How to solve the problem?

Queue also.


Httpsqs

Very simple, based on the HTTP Get/post protocol. PHP, Java, Perl, Shell, Python, Ruby and other programming languages that support the HTTP protocol can be called.

Very fast, in-queue, out-of-queue faster than 10,000 times/second.

High concurrency, support tens of thousands of concurrent connections, c10k is not a problem.

Multi-queue support.

The maximum number of queues supported by a single queue is up to 1 billion.

Low memory consumption, storing dozens of GB of data requires less than 100MB of physical memory buffers.

You can easily modify the maximum number of queues for a single queue without stopping the service.

You can view the status of the queue in real time (into queue location, out queue location, number of unread queues, maximum number of queues).

You can view the contents of the specified queue ID (queue point), including the contents of the queue that are not out and out.

Multiple character set encoding is supported when viewing the contents of a queue. The configuration uses the following one, pre-preparation dependency package http://httpsqs.googlecode.com/files/libevent-2.0.12-stable.tar.gz http://httpsqs.googlecode.com/ Files/tokyocabinet-1.4.47.tar.gz http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz
Second, install the configuration tar zxvf libevent-2.0.12-stable.tar.gz cd libevent-2.0.12-stable/./configure--prefix=/usr/local/ Libevent-2.0.12-stable/make make Install

Tar zxvf tokyocabinet-1.4.47.tar.gz cd tokyocabinet-1.4.47/./configure--prefix=/usr/local/tokyocabinet-1.4.47/# Note: To compile the Tokyo cabinet on a 32-bit Linux operating system, use the./configure--enable-off64 instead./configure, you can make the database file exceed the 2GB limit. #./configure--enable-off64--prefix=/usr/local/tokyocabinet-1.4.47/make make Installtar zxvf httpsqs-1.7.tar.gz CD Httpsqs-1.7/make make Install

Description Success!
Third, use and help document start: httpsqs-d-P 1218-x/data0/queue https://code.google.com/p/httpsqs/

Business commit policy under high concurrency (RPM)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.