हमने हाल ही में उत्पादन में कैसंड्रा डेटाबेस का उपयोग करना शुरू कर दिया है। हमारे पास single cross colo cluster of 24 nodes
है जिसका अर्थ 12 nodes in PHX
और 12 nodes in SLC colo
है। हमारे पास replication factor of 4
है जिसका अर्थ है 2 copies will be there in each datacenter
।कैसंड्रा को बेहतर बनाने के तरीके मेरे परिदृश्य में प्रदर्शन
नीचे जिस तरह से keyspace
और column families
हमारे Production DBA's
द्वारा बनाए गए हैं।
placement_strategy = 'org.apache.cassandra.locator.NetworkTopologyStrategy' के साथ keyspace प्रोफ़ाइल बनाने और strategy_options = {एसएलसी: 2, PHX: 2};
create column family PROFILE_USER with key_validation_class = 'UTF8Type' and comparator = 'UTF8Type' and default_validation_class = 'UTF8Type' and gc_grace = 86400;
हम Cassandra 1.2.2
चल रहे हैं और यह org.apache.cassandra.dht.Murmur3Partitioner
है, KeyCaching
, SizeTieredCompactionStrategy
और Virtual Nodes
को भी सक्षम है। nodes-
16 cores, 32 threads
128GB RAM
4 x 600GB SAS in Raid 10, 1.1TB usable
2 x 10GbaseT NIC, one usable
नीचे कैसेंड्रा उत्पादन के लिए
मशीन निर्दिष्टीकरण परिणाम मैं हो रही है।
Read Latency(95th Percentile) Number of Threads Duration the program was running(in minutes) Throughput(requests/seconds) Total number of id's requested Total number of columns requested
9 milliseconds 10 30 1977 3558701 65815867
मुझे यकीन है कि क्या अन्य बातों के मैं काफी बेहतर read performance
पाने के लिए कैसेंड्रा के साथ बाहर यह कोशिश करनी चाहिए नहीं कर रहा हूँ। मुझे लगता है कि यह मेरे मामले में डिस्क मार रहा है। क्या मुझे कुछ उच्च संख्या में प्रतिकृति फैक्टर को बढ़ाने की कोशिश करनी चाहिए? कोई अन्य सुझाव?
मुझे लगता है कि एसएसडी की तुलना में एचडीडी से डेटा पढ़ने के बारे में 6-12ms है? मेरे मामले में यह हर बार डिस्क को मार रहा है और मुझे लगता है कि कुंजी कैश सक्षम करना ठीक काम नहीं कर रहा है। मैं पंक्ति कैश को सक्षम नहीं कर सकता क्योंकि यह ओएस पेज कैश का उपयोग करने के लिए अधिक कुशल है। JVM में पंक्ति कैश को बनाए रखना बहुत महंगा है, इस प्रकार पंक्तियों की छोटी संख्या के लिए पंक्ति कैश की सिफारिश की जाती है, जैसे < केवल 100K पंक्तियां।
क्या कोई तरीका है कि मैं यह सत्यापित कर सकता हूं कि मेरे मामले में कीकैचिंग ठीक काम कर रही है या नहीं?
यह जब मैं स्तंभ परिवार
create column PROFILE
with column_type = 'Standard'
and comparator = 'UTF8Type'
and default_validation_class = 'UTF8Type'
and key_validation_class = 'UTF8Type'
and read_repair_chance = 0.1
and dclocal_read_repair_chance = 0.0
and populate_io_cache_on_flush = false
and gc_grace = 86400
and min_compaction_threshold = 4
and max_compaction_threshold = 32
and replicate_on_write = true
and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
and caching = 'KEYS_ONLY'
and compression_options = {'sstable_compression' : 'org.apache.cassandra.io.compress.SnappyCompressor'};
के लिए स्कीमा दिखाते हैं कि मैं क्या मिलता है क्या मैं एक परिवर्तन करना चाहिए अच्छा पढ़ा प्रदर्शन प्राप्त करने के है है?
आपकी प्रतिकृति कारक 2. – Schildmeijer
'nodetool cfstats' कुंजी कैश हिट अनुपात – Schildmeijer
आरएफ 4 दिखाएगा। लेकिन प्रत्येक डेटा केंद्र में 2। –