myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "EAG (JIRA)" <>
Subject [jira] [Commented] (MYFACES-3586) Performance improvement in Resource loading - HIGH CPU inflating bytes in ResourceHandlerImpl.handleResourceRequest
Date Tue, 27 Nov 2012 07:23:58 GMT


EAG commented on MYFACES-3586:

Hi, I am also facing the same issue with myfaces 2.1. I am using Primefaces for my web application.
Run a test for 500 users on 4core system. The CPU chocked to 100% when concurreny reached
300 users. The following exception is coming:

Error trying to load resource primefaces.css with library primefaces :Broken pipe

The resource handler definitely needs to be fixed. Otherwise me or the others using myfaces
2.x will not able be to scale the application. Please provide myfaces jar with upgraded resource

Also let me know a way to integrate this available patch so that in future i can upgrade myfaces
with ease.
> Performance improvement in Resource loading - HIGH CPU inflating bytes in ResourceHandlerImpl.handleResourceRequest
> -------------------------------------------------------------------------------------------------------------------
>                 Key: MYFACES-3586
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Improvement
>         Environment: ALL
>            Reporter: Rohit Dilip Kelapure
>         Attachments: MYFACES-3586.patch
>   Original Estimate: 48h
>  Remaining Estimate: 48h
> In a high concurrency load test with Apache MyFaces + RichFaces component library we
found that under peak load majority of our web container threads were stuck in this call stack

> at java/util/zip/Inflater.inflateBytes(Native Method)
> at java/util/zip/Inflater.inflate( Code))
> at java/util/zip/ Code))
> at java/util/zip/ Code))
> at java/io/ Code))
> at java/io/ Code))
> at java/io/ Code))
> at org/apache/myfaces/shared_impl/resource/ResourceImpl$
> at java/io/ Code))
> at java/io/ Code))
> at org/apache/myfaces/application/ResourceHandlerImpl.pipeBytes(
> at org/apache/myfaces/application/ResourceHandlerImpl.handleResourceRequest(
> at org/richfaces/resource/ResourceHandlerImpl.handleResourceRequest(
> at javax/faces/webapp/FacesServlet.service( Code))
> at org/richfaces/webapp/ResourceServlet.httpService(
> at org/richfaces/webapp/ResourceServlet.service( Code))

> After looking at the src code of  org.apache.myfaces.application.ResourceHandlerImpl.handleResourceRequest(FacesContext)
 I can see that the ResourceHandlerCache caches the Resource metadata ; however the actual
output of the resource which is written to the outputstream in ResourceHandlerImpl.pipeBytes
is NEVER cached. 
> This causes a scalability problem in our case because each access to the resource involves
cracking open a jar, inflating the bytes and parsing a stream of bytes. This is done multiple
times for the same resource(say a css file) inside the richfaces jar inspite of the resource
not changing. 
> I propose a much needed performance optimization wherein we cache the output of the Resource
handled and stash the output byte[] it as softReference in the ResourceHandlerCache.ResourceValue.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message