Hi Everyone! We are somewhat concerned about our ...
# community-help
l
Hi Everyone! We are somewhat concerned about our RAM utilization as it's consistently close to our 32GB configuration. Apart from scaling up, is there anything we can do? any recommendations are appreciated 🙌 Also, thanks for the great tool!
j
Typesense is an in-memory datastore, so you'd need enough RAM to hold your dataset in memory. So memory usage is directly proportional to the amount of data you've indexed. One common way to optimize RAM usage would be to look at your collection schema, and remove any fields from the field definitions that you're not using for searching, sorting, filtering, grouping or faceting. For eg, image URLs are typically only used for display purposes, so you can leave those out of the collection schema, but still send the field in the documents into Typesense. These fields present in the documents, but not in the schema are considered unindexed fields and will only be stored on disk and not in RAM. So this will help conserve RAM usage
Another common thing to look for is that you only have
facet: true
on fields that you're using in the
facet_by
search parameter. Faceting requires additional memory. Same with
infix: true
. This requires additional memory as well, and should only be enabled if absolutely needed
Another thing I've seen is old collections that are stale and no longer used - you want to remove those from Typesense, so it doesn't take up RAM unnecessarily
l
Great ideas! Thank you Jason!
👍 1