Performance issues on AWS


#1

Hey,

I would like to ask what configuration you are using for your metabase deployment on AWS.

I’ve launched an instance through the quick start URL last week but I am not having a good experience in terms of performance.

Sometimes the site takes way too long to load (10-15 seconds) even though I am not logged in. When I try to access my questions or dashboards, it also takes forever (5-10 seconds). Then after a while later it becomes responsive and fast again, no idea why. Sometimes when I try accessing my questions by clicking on the UI button it takes forever, but when I open a new browser tab and type the full URL it loads much faster.

By looking at the EB monitoring screen, I don’t see anything abnormal. The CPU is always very low, and the latency spikes seem to be related to the slow database queries.

Besides that, which I believe must have something to do with the EB deployment, I am using RDS/Postgres, which is also performing very poorly. My table has ~450k lines and most of the time a full table scan takes 30-60 seconds to finish. Should I move my data to Redshift or maybe Druid?

Thank you


#2

This looks like you can optimise some paths on your database.

A quick tour on this are to check the following points:

  • What are you questioning, are you writing complex queries?

    Sometimes it is just that simple to reduce complexy in your queries, pre-aggregate results (e.g. materialized views) to speed up complex queries. Do you JOIN a lot of different tables together? Do you aggregate lots of columns? Do you use date_format/date_trunc heavily?

  • Do you have the appropriate indices on the database?

    You can figure that out, by running an EXPLAIN <QUERY> on your common queries.

  • Does the database fit in memory, aka, does the RDS instance have enough RAM to deal with the data?

    That is an important one, because sometimes going to disk to fetch rows is usually the culprit for very slow queries.
    You can figure that out by watching the CloudWatch metrics for Disk I/O.

Hope it helps. Tell me how it goes for you.