Performance Issues with Retool RPC

Hi all - we're experiencing some unexpected performance issues when building our property management dashboard with RPC.

Basic queries are really slow. What are our options here?
Screenshot 2024-05-03 at 1.25.59 PM

Retool RPC

I'm convinced that Retool RPC is the bottleneck because these queries (as posted by @briwong) are resolved within half a second on the server.

Hi there,

Our on call engineers investigated an issue with an uptick in 500 errors on RPC queries on May 2nd, but we were able to resolve it later that day. They're also planning to make some improvements so that issue doesn't happen again in the future.

However, slow queries seems like it could be a different issue, especially if it's still happening. What does it say in the performance popover menu?

Hi Tess,

I've got the same issue. I have built a node app that uses the RPC, which queries a postgres DB through kysely. The performance popover just shows this:
Screenshot 2024-06-14 at 11.09.55
But the database query itself takes just 100ms.
I have also tested an endpoint that just returns a static javascript object and the query also takes around 1.5s.
Screenshot 2024-06-14 at 11.22.41

Also the RPC can only process 1 request at a time right? So every request gets delayed by the previous one, which makes performance way worse.

When I query the database without the RPC I'm down to around 500ms

Hi @alexdanylyschyn, thanks for chiming in.

By default, the polling interval is set to 1s, so you can usually expect some small delay when querying from Retool.

For the issue of requests getting delayed by previous requests, if the work can be done asynchronously (e.g. database operations, http requests, file reads), can you implement your RPC functions as async, so that multiple requests can be handled?

To further improve processing speed you can also spin up multiple different RPC agents and connect it to the same resource--only 1 agent should handle each request.

Tentatively marked the above as a solution, but please let us know if you're still working on this!