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?
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?
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:
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.
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!
Hey @Tess! I’m currently working on this right now as well, though my question is on whether we can reduce the polling interval itself down to 5ms or 10ms.
Also, when it comes to spinning up multiple RPC instances, how is the routing handled for that?
Hey @Tess somehow I didn't get the notification for your reply.
I wouldn't say the a delay of 1s is small, but okay.
I'm still facing the same issue. I've tested different variants, but without any different results.
All my JS functions that get passed to the RPC either return async Promises or are implemented async, but it didn't make any impact on performance.
I think the main issue is the polling rate.
What I still want to try is spawning multiple instances of the same Node app, but I guess those would have to be launched staggered, else the 1s polling delay is in-sync between the instances.
Hi @alexdanylyschyn,
I'm sorry to hear the notification didn't go through and I'm sorry to hear the performance issues are still persisting
.
I shared your feedback directly with the internal team that owns this integration. It sounds like we don't currently have any projects that would improve the performance on our near term roadmap, but I will make sure this is documented as a feature request. I'll reach out here if our team moves forward on better support for lowering the polling interval