Forum OpenACS Q&A: Homepage changes due to performance

I took out the two widgets for "about openacs" and "featured articles" from the frontpage as they have been consuming so much postgres power that it is unsustainable.

They can come back once we either make ETP faster or find a way to memoize ADP includes (or part of the ETP calls).

Collapse
Posted by Andrew Piskorski on
But, they are there now. Did someone fix the performance problems and then put them back?

Why would ADP includes be so expensive? Do they not get compiled to Tcl the same way all the other ADP stuff does?

Collapse
Posted by Dave Bauer on
We found slow queries in the includable adps. Once we resolved the issues that we slowing down the queries the performance increase of those includes was about 10x faster. The home page loads in around 300ms now, which is a huge improvement. In the case of the ETP includes there was a plpgsql function in the where clause of the get_content_items procedure. I rewrote the query and the performance went from 900ms to around 17ms. In the case of the forums include there was a view in a subquery that was causing the PG optimize to make a poor choice. When I rewrote the query to use the table directly the increase also was signifigant. This shows that developer support and explain analyze are very important tools to track down this type of performance issue.
Collapse
Posted by Don Baccus on
The ETP improvements will show up on the 5.1 branch, it merely involves telling PG that the function needs to only be evaluated once per query by attaching the STABLE attribute to the CREATE OR REPLACE FUNCTION statement ... Dave's taking care of this ... Just for those of you who read Malte's comment and think ETP's slow and will remain slow!
Collapse
Posted by Don Baccus on
Andrew, yes, INCLUDEs get compiled just like other templates, the issue wasn't the ADP/Tcl code but rather the queries used by the template code. Malte was talking about possibly caching the ADP include to avoid those calls, that's all.