It is good to configure swap for the OS but exempt Cassandra from swapping. Why is it good? Since you never know the memory utilization of additional agents and processes you or other admins will run on your server.
So do configure a swap partition. You can control the eagerness of the kernel by the swappiness sysctl parameter. You can even control it per cgroup: https://askubuntu.com/questions/967588/how-can-i-prevent-certain-process-from-being-swapped You should make sure Cassandra locks its memory so the kernel won't choose its memory to be swapped out (since it will kill your latency). You do it by mlock. Read more on: https://stackoverflow.com/questions/578137/can-i-tell-linux-not-to-swap-out-a-particular-processes-memory The scylla /dist/common/limits.d/scylladb.com looks like this: scylla - core unlimited scylla - memlock unlimited scylla - nofile 200000 scylla - as unlimited scylla - nproc 8096 On Thu, Apr 16, 2020 at 3:57 PM Nitan Kainth <nitankai...@gmail.com> wrote: > > Swap is controlled by OS and will use it when running short of memory. I > don’t think you can disable at Cassandra level > > > Regards, > > Nitan > > Cell: 510 449 9629 > > > On Apr 16, 2020, at 5:50 PM, Kunal <kunal.v...@gmail.com> wrote: > > > > Hello, > > > > I need some suggestion from you all. I am new to Cassandra and was reading > Cassandra best practices. On one document, it was mentioned that Cassandra > should not be using swap, it degrades the performance. > > My question is instead of disabling swap system wide, can we force Cassandra > not to use swap? Some documentation suggests to use memory_locking_policy in > cassandra.yaml. > > > How do I check if our Cassandra already has this parameter and still uses > swap ? Is there any way i can check this. I already checked cassandra.yaml > and dont see this parameter. Is there any other place i can check and confirm? > > > Also, Can I set memlock parameter to unlimited (64kB default), so entire Heap > (Xms = Xmx) can be locked at node startup ? Will that help? > > > Or if you have any other suggestions, please let me know. > > > > > > Regards, > > Kunal > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org For additional commands, e-mail: user-h...@cassandra.apache.org