In my previous post, I discussed about how to stress test Cassandra. In this post, I will discuss on some easy steps to tune-up its performance. I'm a big fan of Cassandra. It is optimized for very fast and highly available data write. There are so many things you can do to optimize its write and read performance further. But today, I will only discuss on some major and easy tune-up steps which you can apply easily.
Dedicated Commit Log Disk: I think this is the first tune-up you may want to try as it gives you a significant performance improvement. But before changing commit log destination it would be better to know it gives performance boost. Cassandra write operations are occurred on a commit log on disk and then to an in-memory table structure called Memtable. When thresholds are reached, that Memtable is flushed to a disk in a format called SSTable. So if you separate out Commit Log locations, it will isolate Commit Log I/O traffics from other Cassandra Reads, Memtables and SSTables traffics. Remember, after the flush, the Commit Log is no longer needed and is deleted. So the Commit Log disk doesn't need to be large. It just need to be in the size where it can holds Memtable data before its flushed. You can follow the following steps to change commit log location for Cassandra.
Step#1: Mount a separate partition for commit log
Step#2: Make sure you give expected ownership and access on that drive
Step#3: Edit Cassandra configuration file which can be found at conf/cassandra.yaml. You will find a property "CommitLogDirectory", update it based on your mount location. For my case, it will be:
CommitLogDirectory: /mnt/commitlog
Step#4: Restart your Cassandra cluster.
Increasing Java Heap Size: Cassandra runs on JVM. So you might face out of memory issues when you run a heavy load on Cassandra. There is also a rule of thumb about how you want to keep your heap size.
- Heap Size = 1/2 of System Memory when System Memory < 2GB
- Heap Size = 1GB when System Memory >= 2GB and <= 4GB
- Heap Size = 1/4 of System Memory(but not more than 8GB) when System Memory >4GB
Remember, just a larger heap size might not give you a performance boost. So a well-tuned Java heap size is very important. To change the Java heap size, you need to update cassandra-env.sh file and then restart Cassandra cluster again. If you are using Opscenter, you should see the updated heap size on one of the Opscenter's metrics.
Tune Concurrent Reads and Writes: Staged Event-Driven Architecture(SEDA) is used for implementing Cassandra. It breaks the application into stages. Concurrent readers and writers control the maximum number of threads allocated to a particular stage. So having an optimal concurrent reads and concurrent writes value will improve Cassandra performance. But raising these values beyond the limit will decrease Cassandra performance. These values are highly tied with CPU cores of the system. As like, Java heap size, there is also a rule of thumb about how to select these values:
- Concurrent Reads: 4 concurrent reads per processor core
- Concurrent Writes: Most of the time you do not need it as write is usually fast. If needed, you can set the value to equal or higher than the concurrent reads.
Tune-Up Key Cache: For each of the column families, key cache holds the location of row keys in memory. Since keys are usually small, it can store a large cache without using much memory. Each cache hit results in less disk activity. 200000 is the default key cache size of Cassandra and its enabled by default. You can alter the default value by following:
You can monitor key cache performance by using nodetool cfstats command.
Tune-Up Row Cache: In Cassandra, row cache is disabled by default. Row cache holds the entire content of the date in memory. So a column family with large rows could easily consume system memory and could impact Cassandra performance, that's why its disabled by default and should be remain disabled in most of the cases. But if your column data is too small then using row cache will significantly improve performance as row cache keeps the most accessed rows hot in memory. To enable row cache, you can alter your column family and can pass number of rows for row cache.
You can also monitor it by using nodetool cfstats command like above (watch for ."Row cache hit rate").
Conclusion: As I said early, these are only some of the tune-up steps, there are more (high performing RAID level, file system optimization, disabling swap memory, memory mapped disk modes and so on). But I gave you something you can start with, once you find out improved Cassandra performance you can try the rest of the tuning. Cassandra is highly scalable and scaling up is done by enhancing each node (more RAM, high network throughput, SSD, disk size, etc). Remember, if you are using AWS EC2 instance do not expect much performance improvement if you are using medium or small type instance as they are not optimized for better I/O or network, use xlarge+ instance instead.
And finally, DO NOT forget to check the Cassandra Performance and Scalability slides by Adrian Cockcroft.
Note: For privacy purpose, I had to modify several lines on this post from my original post. So if you find something is not working or facing any issues, please do not hesitate to contact me :)
The blog gave me idea about cassandra performance tunning Thanks for sharing it
ReplyDeleteHadoop Training in Chennai
Thanks for sharing your valuable and interesting article..
ReplyDeleteEmbedded Project Center in Chennai | Embedded Project Center in Velachery
Great post. Wonderful information and really very much useful. Thanks for sharing and keep updating.
ReplyDeleteBest Summer Courses for professional students in Chennai|Best Summer Courses for professional students in Ashok Nagar
The actual time and effort taken to create this wonderful article were really great and I am really very much impressed with this blog keep updating us...
ReplyDeleteBest Online Software Training Institute | Cassandra Training
good blog
ReplyDeleteReally I Appreciate The Effort You Made To Share The Knowledge about cassandra performance tuning. This Is Really A Great Stuff For Sharing. Keep It Up . Thanks For Sharing.
ReplyDeleteCloud Training
Cloud Training in Chennai
Casino is not just a game but a lifestyle, come in, play and be stylish. roulette online The best casino is only on BGAOC and nowhere else.
ReplyDeleteI really like this site certain best online casino games to win money I sat there all day figured out that yes how I really like this site, I sat there all day figured out that yes and now I do not worry that someone will deceive me
ReplyDeleteReally very great information to be provided and the All points discussed were worth reading and i’ll surely work with them all one by one.
ReplyDeleteBest C and C++ Programming Training Academy in Kanchipuram
Awesome post. Really you are shared very informative concept... Thank you for sharing. Keep on updating...
ReplyDeleteBest Java Training Academy in Kanchipuram
Thank you for the link on Adrian Cockroft's slides about Cassandra Performance and Scalability, it turned to be a piece of very useful information.
ReplyDeleteI like the blog format as you create user engagement in the complete article. Thanks for the informative posts.
ReplyDeleteBig Data Hadoop Training In Chennai | Big Data Hadoop Training In anna nagar | Big Data Hadoop Training In omr | Big Data Hadoop Training In porur | Big Data Hadoop Training In tambaram | Big Data Hadoop Training In velachery
Thanks for your informative article,Your post helped me to understand the future and career prospects & Keep on updating your blog with such awesome article.
ReplyDeleteangular js training in chennai
angular js training in porur
full stack training in chennai
full stack training in porur
php training in chennai
php training in porur
photoshop training in chennai
photoshop training in porur
I have express a few of the articles on your website now, and I really like your style of blogging. I added it to my favorite’s blog site list and will be checking back soon…
ReplyDeletesap training in chennai
sap training in velachery
azure training in chennai
azure training in velachery
cyber security course in chennai
cyber security course in velachery
ethical hacking course in chennai
ethical hacking course in velachery
Excellent content! Thanks for sharing such a useful information.
ReplyDeleteBest Data Science Training Institute in Pune
Data Science Training Institute in Bangalore
Data Science Certification Course in Bangalore
cami avizesi - no deposit bonus forex 2021 - takipçi satın al - takipçi satın al - takipçi satın al - takipcialdim.com/tiktok-takipci-satin-al/ - instagram beğeni satın al - instagram beğeni satın al - google haritalara yer ekleme - btcturk - tiktok izlenme satın al - sms onay - youtube izlenme satın al - google haritalara yer ekleme - no deposit bonus forex 2021 - tiktok jeton hilesi - tiktok beğeni satın al - binance - takipçi satın al - uc satın al - finanspedia.com - sms onay - sms onay - tiktok takipçi satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - tiktok takipçi satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - perde modelleri - instagram takipçi satın al - takipçi satın al - instagram takipçi satın al - betboo
ReplyDeleteinstagram takipçi satın al
ReplyDeleteinstagram takipçi satın al
takipçi satın al
takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
aşk kitapları
tiktok takipçi satın al
instagram beğeni satın al
youtube abone satın al
twitter takipçi satın al
tiktok beğeni satın al
tiktok izlenme satın al
twitter takipçi satın al
tiktok takipçi satın al
youtube abone satın al
tiktok beğeni satın al
instagram beğeni satın al
trend topic satın al
trend topic satın al
youtube abone satın al
beğeni satın al
tiktok izlenme satın al
sms onay
youtube izlenme satın al
tiktok beğeni satın al
sms onay
sms onay
perde modelleri
instagram takipçi satın al
takipçi satın al
tiktok jeton hilesi
pubg uc satın al
sultanbet
marsbahis
betboo
betboo
betboo
instagram takipçi satın al
ReplyDeleteucuz takipçi
takipçi satın al
https://takipcikenti.com
https://ucsatinal.org
instagram takipçi satın al
https://perdemodelleri.org
https://yazanadam.com
instagram takipçi satın al
balon perdeler
petek üstü perde
mutfak tül modelleri
kısa perde modelleri
fon perde modelleri
tül perde modelleri
https://atakanmedya.com
https://fatihmedya.com
https://smmpaketleri.com
https://takipcialdim.com
https://yazanadam.com
yasaklı sitelere giriş
aşk kitapları
yabancı şarkılar
sigorta sorgula
https://cozumlec.com
word indir ücretsiz
tiktok jeton hilesi
rastgele görüntülü sohbet
erkek spor ayakkabı
fitness moves
gym workouts
https://marsbahiscasino.org
http://4mcafee.com
http://paydayloansonlineare.com
marsbahis
ReplyDeletebetboo
sultanbet
marsbahis
betboo
sultanbet
woori casino in vegas - Armah Hospitality Clinic
ReplyDeletewoori casino in vegas. 우리 카지노 총판 모집 Our Васках - woori 바카라 노하우 casino in vegas is a 우리 카지노 먹튀 casino located near the Wynn Las Vegas 메리트 카지노 쿠폰 and is open daily 24 바카라 사이트 hours.
Casino Finder - Find Casinos Near You (2021)
ReplyDeleteFind Casinos netteller Near You (2021) 윈벳 with 7 포커 Local 승인전화없는 토토 Casinos Near You (2021). ✓ Find Casinos Near You (2021) 해외 배팅 with Local Casinos Near You (2021).
seo fiyatları
ReplyDeletesaç ekimi
dedektör
instagram takipçi satın al
ankara evden eve nakliyat
fantezi iç giyim
sosyal medya yönetimi
mobil ödeme bozdurma
kripto para nasıl alınır
bitcoin nasıl alınır
ReplyDeletetiktok jeton hilesi
youtube abone satın al
gate io güvenilir mi
referans kimliği nedir
tiktok takipçi satın al
bitcoin nasıl alınır
mobil ödeme bozdurma
mobil ödeme bozdurma
perde modelleri
ReplyDeleteSms onay
Turkcell mobil ödeme bozdurma
NFT NASİL ALINIR
ankara evden eve nakliyat
trafik sigortası
Dedektör
Website.kurma
aşk kitapları
Smm panel
ReplyDeleteSMM PANEL
Https://isilanlariblog.com/
İnstagram takipçi satın al
Hırdavatçı burada
Www.beyazesyateknikservisi.com.tr
servis
tiktok jeton hilesi
nft nasıl alınır
ReplyDeleteen son çıkan perde modelleri
lisans satın al
en son çıkan perde modelleri
yurtdışı kargo
özel ambulans
uc satın al
minecraft premium
Good content. You write beautiful things.
ReplyDeletevbet
hacklink
hacklink
vbet
sportsbet
taksi
sportsbet
korsan taksi
mrbahis
Good content. You write beautiful things.
ReplyDeletesportsbet
vbet
hacklink
vbet
mrbahis
mrbahis
korsan taksi
taksi
sportsbet
Good text Write good content success. Thank you
ReplyDeletemobil ödeme bahis
bonus veren siteler
tipobet
betpark
kibris bahis siteleri
poker siteleri
betmatik
slot siteleri
Good article text write content successfull... thanks.
ReplyDeletekralbet
bonus veren siteler
kibris bahis siteleri
mobil ödeme bahis
betmatik
poker siteleri
slot siteleri
tipobet
It is an excellent blog Thank you for providing important information and I am searching for the same information, Thank you for sharing good content.
ReplyDeleteSAP Training in Bangalore
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
EFQS6R
milas
ReplyDeleteartvin
eyüpsultan
adıyaman
bingöl
FAA