Trying to get better Graph performance

I am having an issue with loading data for some XY graphs. I have Ignition Cloud on an AWS t3.medium. It's connected to a Postgres db.t4g.micro. On the page that is having issues there are 11 XY graphs. My gateway is timing out after 10 seconds (I increased it troubleshooting this issue) when trying to get Tag History. I'm the only one using the page because it's still in development. This is a demo project. I haven't implemented the Realtime toggle and considering deleting it after the page is having trouble loading 11 graphs.

Page

As this is a demo, the data doesn't come from a PLC. I created a .NET app that runs on a laptop that connects to a local Ignition Gateway and changes tags at a rate of 500ms via a separate port on the gateway from the internet. This Gateway is connected to the AWS server and uses the AWS historian for these Demo tags. The app is designed so it only changes relevant tags to the simulation. I have changed the simulation rate to 1 sec and the store and forward rate is between 2 -4 datapoints/sec.

Store & Forward from Local Gateway

The data bindings on the graphs is using Tag History Historical with starting date based on a datetimeinput and end date on another datetimeinput. They tag data path comes from a custom param.

Custom Param

The Postgres database doesn't seem to be overwhelmed, but this is the first time I've ever investigated a database for performance issues.

Posgres Metrics

Ideally I could perform the queries on the graphs as they become visible to reduce load, but I haven't found anything on pagination or loading as you scroll. What can I do to reduce the load of these graphs?

Error on Gateway

Can you show the status of the database connections when you are running this?

Gateway Web page-status-databases-History DB-Details

What you are showing should not be timing out with any standard history query.

Here's DB Connections page on the Cloud:

Cloud DB Connections

DB Details while a query ongoing

I hope this is what you are looking for.

Edit:

Metric Dashboard on DB queries

I'd suggest minimizing the load first to see what that looks like and then work from there adding things back in. For example drop the number of points in the query on each graph to like 10 it to historical mode set to a 1 minute window. See if that loads to determine if it's just a loading issue or if its something else.

I'd also monitor your network traffic through task manager and see if you're seeing a spike. Once I ran into an issue where one chart was pulling 10-20mbps of load just because it had a lot of data points and was accidently set to real time mode.

Here is some screenshots for network traffic.

Local Gateway (2 ports)

Cloud Gateway during query

The max tx speed seems a little high. I tried it a couple times after this high spike and I couldn't get it to tx that fast again.

Follow up test

Edit 2: after some further testing I believe the high tx speed correlates to when a new session is started.

Changed all graphs to only 10 points.

Page after changing all graphs to 10 points

2nd error

Edit: could my custom param paths not be built and the graphs are sending out a Tag History request for null? Seems odd that it would do this and that a null request would cause a server error.

Could it possibly be the tags on the local gateway?

Example Local Tag