Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
German Tugores
Number of portlets in same war file and performance
November 12, 2012 12:22 PM
Answer

German Tugores

Rank: Junior Member

Posts: 33

Join Date: March 1, 2012

Recent Posts

Hello community,

I have a question regarding liferay's performance, basically does the number of portlets defined in the same .war file affect it? I'm developing a solution that requires interaction between many portlets so they have to go in the same war file, can this be a drag on performance? Thanks in advance.

Germán
Hitoshi Ozawa
RE: Number of portlets in same war file and performance
November 12, 2012 1:33 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

Putting them in the same war will increase running performance if there is enough physical memory to load the entire war. Monitor your processor and physical memory usage to make sure there's still room.
German Tugores
RE: Number of portlets in same war file and performance
November 12, 2012 3:04 PM
Answer

German Tugores

Rank: Junior Member

Posts: 33

Join Date: March 1, 2012

Recent Posts

Ok, thanks for the quick reply Hitoshi!
Hitoshi Ozawa
RE: Number of portlets in same war file and performance
November 12, 2012 6:15 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

The downside is that you'll have to deploy/undeploy all the portets in the war file. If you'll doing an update, you'll have to redeploy the entire portlets in the war.
David H Nebinger
RE: Number of portlets in same war file and performance
November 12, 2012 6:56 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 5742

Join Date: September 1, 2006

Recent Posts

There are other things to keep in mind when bundling multiple portlets in a single WAR:

* Since they are all in the same WAR, they share the same class loader. This can reduce the overall system memory usage since only one copy of the jars would be loaded for all of the shared portlets.
* System startup will be faster as it is faster for the application container to load multiple portlets from a single WAR than it is to load separate portlets from separate WARs.
* The portlets will all share the same HTTP session, although they still have separate portlet sessions.
* Fault(s) in one of the portlet(s) may affect other portlets in the same WAR file.
* If using Spring, all of the portlets will share the same Spring context.

Now the real question here centers around your statement:

I'm developing a solution that requires interaction between many portlets so they have to go in the same war file


Why do you think this? IPC does not require the portlets to be in the same war. Liferay message bus (another communication pathway) doesn't have this requirement. In fact, the only way to have them interact that is required by putting them in the same war is the access to the HTTP session, but this is not a generally used mechanism.
Sushil Kumar Saini
RE: Number of portlets in same war file and performance
November 12, 2012 9:18 PM
Answer

Sushil Kumar Saini

Rank: Regular Member

Posts: 100

Join Date: July 27, 2011

Recent Posts

Thanks for such a detailed explanation. It will really help in deciding when to put portlets in same and when to put in the different wars.
David H Nebinger
RE: Number of portlets in same war file and performance
November 13, 2012 5:47 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 5742

Join Date: September 1, 2006

Recent Posts

As a rule I will typically group related portlets into a single war. For example, if the portlets will all be used on the same page (and only on the same page), I'll group them together to reduce runtime impact.

Also if the portlets would benefit from being able to share an object pool of some kind, I'll bundle them in this case also.

Otherwise I'll keep them separate so I don't have the deployment issues that Hitoshi mentioned.