Redis vs Mongo for Data DB:

44 views
Skip to first unread message

వెంకటేష్ ఎన్నల

unread,
Jul 19, 2019, 9:21:10 AM7/19/19
to CGRateS
Hi,

Currently we are using mongo atlas for both stor db and data db. As we need to deal with huge number of documents ( More than a billion ) ... the indexes we had were big and we were getting performance degradation after certain limits. So we currently experimenting on using RDS for stor db and Redis cache for data db.

Current Configuration:
Data db: mongo ( with 8 vCpus)
Stor db: mongo ( with 8 vCpus)
CPS: We were getting around 900 CPS with this configuration when data is small.

New Configuration 1:
Data db: Redis cache ( with 4 vCpus)
Stor db: Postgres ( with 8 vCpus)
CPS: We got only around 200 CPS.

New Configuration 2:
Data db: mongo ( with 2 vCpus)
Stor db: Postgres ( with 8 vCpus)
CPS: We got around the initial 900 CPS which we had before with current configuration.

In conclusion we had bad cps when using redis as data db. In general redis cache should be faster than using a mongo ... so I was not sure if I was making some mistake.
Appreciate inputs from any one who worked on these lines before.

Thanks.

Teofil Voivozeanu

unread,
Jul 22, 2019, 4:20:17 AM7/22/19
to CGRateS
Hi Venkat,

It's a bit hard to estimate, but in our tests, Redis was faster then mongo.
What you can do is a CPU profiling and send it to us. ( when you start the engine you will need to specify the directory where to save the cpu profiling with the flag "-cpuprof_dir" eg: cgr-engine -cpuprof_dir="/tmp" ) 
Also if you want instead of writing a file you can do HTTP prof by specifying httprof_path.
Here you have a link with helpful information : 

Thanks,
TeoV


Reply all
Reply to author
Forward
0 new messages