Tokyo Tyrant (Ttserver) Series-Introduction and Installation

Source: Internet
Author: User

Tokyo Cabinet is a dbm database developed by Mikio Hirabayashi (note: The famous DBM database のページ was developed by him), and the database reads and writes very quickly. insert:0.4sec/1000000 Recordes (2500000QPS), it only takes 0.4 seconds to write 1 million data. search:0.33sec/1000000 recordes (3000000 QPS), it takes only 0.33 seconds to read 1 million data. The following figure shows the performance test for various Key-value database reading and writing data, which can be seen that the speed of Tokyo cabinet is very fast.

Tokyo Tyrant provides a network interface to the DBM database Tokyo cabinet. It communicates using simple TCP/IP based simple binary protocols. At the same time it possesses memcached compatibility protocol and can exchange data with http/1.1 protocol. So it implements Cross-platform, cross language use Tokyo tyrant. Use hot backup, update logging, Replication (replication) to achieve high availability and high reliability. So far, Tokyo tyrant can only run on Inux, FreeBSD, Mac OS X, Solaris.

Below we describe how to install Tokyo tyrant.

First we install Tokyo Cabinet.

]#wget http://tokyocabinet.sourceforge.net/tokyocabinet- 1.4.9.tar.gz
]#tar -xzvf tokyocabinet-1.4.9.tar.gz
]# cd tokyocabinet-1.4.9
]# ./configure
]# make
]# make install

OK, we installed the Tokyo Cabinet, and then continue to install Tokyo Tyrant.

]# wget http://tokyocabinet.sourceforge.net/tyrantpkg/tokyotyrant- 1.1.16.tar.gz
]# tar -xzvf tokyotyrant-1.1.16.tar.gz
]#cd tokyotyrant-1.1.16
]# ./configure
]# make
]#make install

OK, we have now completed the installation of Tokyo Tyrant. The installation is very simple. Installed Tokyo Tyrant Startup program file called Ttserver, so we are also referred to as ttserver. Below we simply start a database to test whether we have successfully installed.

]#./ttservctl Start

Boot complete. This is a startup script, you can copy to any directory, modify the parameters inside.

]# telnet 127.0.0.1 1978

We then telnet to port 1978 because the script that was started by default used 1978 ports.

If it goes well, you can see that you can connect, type stats then enter, and you can see some state information similar to the following

Stats

STAT PID 24755

STAT Uptime 37

STAT Time 1236396011

STAT version 1.1.16

STAT Rusage_user 0.000000

STAT Rusage_system 0.008998

STAT Curr_items 0

STAT bytes 4198720

End

Note that under a 32-bit operating system, a single database file for Tokyo cabinet cannot exceed 2G, while under 64-bit operating systems there is no limit. So it is recommended to use 64-bit operating systems and CPUs. Later topics (not regularly updated):

Start-up parameters and performance optimization of Tokyo tyrant

Some problems and solutions of Memcache Compatibility protocol for Tokyo Tyrant

High availability and high reliability of Tokyo tyrant

Tokyo Tyrant and Nginx combine to achieve high concurrency and high availability

Retrofit Tokyo Tyrant for high-performance Ajax server-side

Constructing a FIFO queue server with Tokyo tyrant

Working with instances

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.