In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what are the common problems of TcaplusDB". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
How does gameserver eliminate an invalid tcaproxy (access layer) node?
Here, TcaplusDB API provides disaster recovery for tcaproxy exceptions. There are two main ways for API to eliminate invalid tcaproxy processes:
API physically believes that a tcaproxy is not available. API sends heartbeat detection packets to all linked tcaproxy every 1 second. If a gameserver does not receive a corresponding heartbeat packet from tcaproxy within 10 seconds, API will actively disconnect the TCP link with tcaproxy and actively link the tcaproxy in the next onupdate.
API logically believes that tcaproxy is unavailable, which is to calculate the request / response ratio of a tcaproxy every 10 seconds. The threshold for API to time out a request packet is 3s. If the request is timed out more than 3 times, the tcaproxy is considered unavailable. The request will not be sent to the tcaproxy. After 60s, the getmetdata request will be sent. If the tcaproxy can process the getmetadata request correctly, the API will consider the tcaproxy available again, and the request will be sent to the tcaproxy again.
In terms of phenomenon, if gameserver finds that a tcaproxy is unavailable within 10 seconds, it will no longer send data to that tcaproxy node.
How does gameserver choose the tcaproxy (access layer) node?
Gameserver maintains a consistent Hash ring locally, which is added to the Hash ring after the authentication of a tcaproxy (access layer) node is passed. If a tcaproxy (access layer) node is reduced or the TCP link between gameserver and tcaproxy (access layer) is broken due to a machine anomaly, gameserver will remove the tcaproxy (access layer) node from the Hash ring. Gameserver calculates the hash value according to the primary key in the request (in the case of a batchget request, a single tcaproxy (access layer) node is randomly selected), and then a single tcaproxy (access layer) node is selected on the consistent Hash ring to send it.
Does TcaplusDB have compression function?
TcaplusDB has compression function, and the compression algorithm adopted is Google snappy compression algorithm, including protocol compression, that is, the compression function of request / response packets between gameserver tcaproxy (access layer). Data compression, that is, tcapsvr (storage layer) will compress the data to be stored during data storage. If you need to save network traffic between gameserver tcaproxy, it is recommended to enable protocol compression, call the function SetCompressSwitch of TcaplusDB API, and enable tcapsvr (storage layer) compression. It is also a controllable problem to save disk space and improve IO disk performance while compressing and decompressing CPU.
Is TcaplusDB API thread safe?
TcaplusDB API is non-thread-safe, mainly because components such as tlog and tdr are non-thread-safe. It is recommended to use a single API object for a single thread and a single API object for a single game area. If you need to interact across game areas, it is recommended that a single gameserver maintain multiple API objects.
What is the disaster recovery of tcaproxy (access layer)?
Tcaproxy (access layer) adopts peer-to-peer design, that is, all tcaproxy (access layer) nodes under a single game area contain routing information of all tables under a single game area. If a tcaproxy (access layer) fails, as long as the remaining tcaproxy (access layer) nodes are not overloaded, gameserver will eliminate abnormal tcaproxy (access layer) nodes and will not affect the use of gameserver. Tcaproxy (access layer) does not have a single point of risk.
How is the disaster recovery of tcapsvr (storage layer) done?
Tcapsvr (storage layer) runs in the mode of one tcapsvr master and one tcapsvr slave. Tcapsvr master/slave synchronizes data in real time and deploys different IDC in the same city to ensure that the master-slave synchronization delay is less than 10ms. If tcapsvr slave is abnormal, it will not affect the use of gameserver (read shunting is not enabled. Gameserver requests are processed by tcapsvr master. If read shunting is enabled, tcapsvr slave will assist in processing partial read requests. DBA can reconstruct tcapsvr slave. If the tcapsvr master is abnormal, the tcapsvr slave will recover from the failure, and the DBA can apply for the tcapsvr slave reconstruction of the new machine. There is no risk of a single point of tcapsvr (storage layer).
Does TcaplusDB have overload protection?
Both the access layer and the storage layer have process-level overload protection measures to ensure that the service does not avalanche during the business peak.
What is the principle of hot and cold data exchange in TcaplusDB?
TcaplusDB uses memory + SSD disk storage, single engine file, former 1GB mapping in memory, hot data in memory as far as possible, cold data on disk, cold and hot data exchange using LRU algorithm, get operation of gameserver triggers LRU swap operation, and LRU thread of tcapsvr (storage layer) is responsible for LRU swapping operation to ensure that hot data is stored in memory as far as possible to ensure high cache hit rate and low read and write latency.
How does tcaproxy (access layer) choose tcapsvr (Storage layer)?
Each table defines a sub-table factor. If no sub-table is defined, the sub-table factor is the primary key by default. Tcaproxy (access layer) selects the corresponding tcapsvr (storage layer) according to hash (sub-table factor)% 1w, so the dispersion of the sub-table factor is high.
What is the level of TcaplusDB locks?
The granularity of TcaplusDB locks is at the record level.
This is the end of the content of "what are the frequently asked questions on TcaplusDB". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.