Baldur, On 2/25/16 4:44 PM, Baldur Dae wrote: > I have a Primefaces webapp which lets users upload files up to 50MB and > saves posted files into Alfresco (located in another tomcat machine). I've > successfully configured it to avoid Heap exceptions but it is very slow > and has a huge impact in CPU load.
If you use Tomcat to upload your files, it should not be using a lot of CPU, nor should it require a great deal of memory. Tomcat can be configured to put the in-progress uploading file onto the disk instead of in memory. There is a size threshold that triggers this to avoid the foolishness of storing 50MiB of data in the heap during an upload. > Basically, the configuration has involved these steps: > - web.xml (PrimeFaces FileUpload Filter): thresholdSize set to 1MB PrimeFaces upload filter. This is the component performing the upload, not Tomcat. Please review the configuration of this filter. Perhaps there are trade-offs being made. > - Tomcat: maxPostSize parameter set to 0 Does the PrimeFaces upload filter use POST or something else? (POST is typical, but it could be a PUT) > - Webapp: saves posted file using InputStream ( > http://stackoverflow.com/questions/10326460/how-to-avoid-outofmemoryerror-when-uploading-a-large-file-using-jersey-client > ) > > How can I improve it? Is it just a hardware problem? Probably not a hardware problem. The great thing about processes that are taking a lot of time is that you can take some thread dumps[1] to see what the process is doing. -chris [1] http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org