How often does compaction run

I am trying to find out by default how often does Rocksdb compaction run? Does it get run at a regular interval or does it get trigger when certain conditions are met?

Normally it runs when certain conditions are met (e.g. number of L0 files or else size of the level exceed a threshold) . There are methods that you can use to prevent or start compaction if you need control over this