My first try showed that Lucene is called a lot of times, even when server is on "idle" state. Maybe it is a background job that should have a smaller frequency.
The second try filters out Lucene classes (using NB Profiler options). I found two bootlenecks: com.liferay.portal.lucene.IndexWriterFactory.decrement (takes 58% of startup time) and JBoss classloaders. And I found that Liferay auto deploy is running too often (~5 seconds of delay). Nice for develoment, awful for production use.
I had to remove JBoss classes from profiling, and I got amazed on things I discovered. I got a OutOfMemoryError (perm gen space) - solved by adding "-XX:MaxPermSize=256m" to run script - but I could find a lot of interesting things:
- getResourceAsStream was called 12068 times;
- Xerces' ChildNode was instantiated 853808 times (does anybody imagine why Java is "slow"?);
- Stacktrace got really deep. About 50 levels or more, not including JBoss, Lucene and JDK classes;
- A chain of 7 filters was called before hitting Liferay's MainServlet. If you consider a little forward made after MainServlet, we reach 14 filters before hitting a JSP file;
- JSP compilation took 19s on this environment - total execution was 180s;
- LR's VelocityTaglib has 8 iconXXX() methods that took 8 seconds each - detail: each one forwards another request;
- Everytime a "include" is made, the chain of 7 filter is called. And there's a LOT of includes.
No comments:
Post a Comment