Tokyo tyrant (ttserver) series-introduction and Installation
[ArticleAuthor: Sun Li link: http://www.cnblogs.com/sunli/] Tokyo cabinet is a dBm database developed by Mikio hirabayashi (pinglin Xiong), Japanese ージ (note: the well-known dBm database qdbm is developed by him). The database reads and writes very quickly. Insert: 0.4sec/1000000 recordes (2500000qps). It takes only 1 million seconds to write 0.4 of data. Search: 0.33sec/1000000 recordes (3000000 QPS). It takes only 1 million seconds to read 0.33 of data. For the performance tests of various key-value databases for reading and writing data, we can see that the speed of Tokyo cabinet is very fast. Tokyo tyrant provides network interfaces for the DBM database Tokyo cabinet. It uses a simple binary protocol based on TCP/IP for communication. It also has memcached compatibility protocol and can use HTTP/1.1 protocol for data exchange. Therefore, it implements cross-platform and cross-Language Use of Tokyo tyrant. Hot Backup, log update, and replication are used to achieve high availability and high reliability. So far, Tokyo tyrant can only run in inux, FreeBSD, Mac OS X, and Solaris.
The following describes how to install Tokyo tyrant.
First, install Tokyo cabinet.
] # Wget http://tokyocabinet.sourceforge.net/tokyocabinet-1.4.9.tar.gz Tokyocabinet-1.4.9.tar.gz] # tar-xzvf # Cd tokyocabinet-1.4.9 ] #./Configure ] # Make ] # Make install |
OK. We have installed Tokyo cabinet and 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. Now we have completed the installation of Tokyo tyrant. Installation is very simple. Start of the installed Tokyo tyrantProgramThe file is called ttserver, so we also referred to as ttserver. Below we simply start a database and test whether we have installed it successfully. ] #./Ttservctl start
Startup is complete. This is a built-in STARTUP script. You can copy it to any directory and modify the parameters.
] # Telnet fig 1978
Then telnet to port 1978, because the database started by the script just now uses port 1978 by default.
If the connection succeeds, you can see the connectivity, type stats, and press enter to see some status information similar to the following.
Statsstat PID 24755 stat uptime 37 stat time 1236396011 stat version 1.1.16stat rusage_user 0.000000 stat rusage_system 0.008998 stat curr_items 0 stat bytes 4198720end |
Note: In a 32-bit operating system, the size of a single database file in Tokyo cabinet cannot exceed 2 GB, but not in a 64-bit operating system. Therefore, we recommend that you use a 64-bit operating system and CPU.Subsequent topics (occasionally updated ):Tokyo tyrant startup parameters and performance optimization
Problems and Solutions of Tokyo tyrant's memcache compatibility Protocol
High availability and reliability of Tokyo tyrant
The combination of Tokyo tyrant and nginx achieves high concurrency and high availability
Transform Tokyo tyrant for high-performance Ajax servers
Use Tokyo tyrant to construct a FIFO queue Server
Use instance