You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Richard Koch <ri...@talkshoe.com> on 2006/10/25 18:32:11 UTC

fileupload makes tomcat 5.5 unresponsive for other users

I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
<t:inputFileUpload> tag.  Out application server is Tomcat 5.5.

 

When a user uploads a file, tomcat becomes completely unresponsive to any
other requests until the upload is complete-this is the case no matter what
the file size is 8K to 40MB.

 

Watching garbage collection logging details, I see that the file upload
component always seems to take at least 32MB or 42MB, and then it is quickly
collected when the upload is completed, and the tomcat server is then
available to everyone.

 

I used the input stream from the
org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call, and
then write it out using the below method.

 

Any ideas what would be causing tomcat to be non-responsive to any other
request until the upload is finished?  Are there any configuration tweeks
that can made to help.  I have scanned the mail archives, wiki, and
documentation without luck.  Perhaps I have missed something?

 

Thanks.

 

Rich K.

----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------------------------------

 

      /**

       * Write the given input stream to the given file identified by the
targetFilePath string.

       * @param inputStream

       * @param targetFilePath

       * @throws IOException

       */

      public static void writeInputStreamToFile(InputStream inputStream,
String targetFilePath) throws IOException {

        InputStream in = 

            new BufferedInputStream(inputStream);

        OutputStream out = 

            new FileOutputStream(targetFilePath);

        try {

            byte[] buffer = new byte[64 * 1024];

            int count;

            while ((count = in.read(buffer)) > 0) {

                  out.write(buffer, 0, count);

            }

        } finally {

            in.close();

            out.close();

        }

      }


Re: fileupload makes tomcat 5.5 unresponsive for other users

Posted by Martin Cooper <ma...@apache.org>.
On 10/26/06, Richard Koch <ri...@talkshoe.com> wrote:
>
> It sounds like it, but we are not using SingleThreadModel anywhere in our
> code.  Also we do not set our JSPs to turn off threads either (which can
> be
> done through <%@ page isThreadSafe="false" %>).
>
> I have not started digging into the apache code yet; perhaps
> SingleThreadModel is used in the file upload components...?


There's certainly nothing in Commons FileUpload itself that could do this,
since it simply runs in the current thread (i.e. the one the container
selected for processing the request). It's more likely to be something in
Tomcat, I would think, since it's the thing that's managing all the threads
in this scenario.

--
Martin Cooper


Someone mentioned the idea that this might also be a file io issue that
> blocks the whole tomcat java process, but I have yet to prove that.
>
> -----Original Message-----
> From: mfncooper@gmail.com [mailto:mfncooper@gmail.com] On Behalf Of Martin
> Cooper
> Sent: Thursday, October 26, 2006 1:53 PM
> To: Jakarta Commons Users List; richk@talkshoe.com
> Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users
>
> On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
> >
> > Unfortunately, tomcat is not responding to *any* requests until the
> upload
> > completes.  After the upload, everything is fine.
>
>
> This sounds a whole lot like you're using SingleThreadModel in the servlet
> that's doing the upload.
>
> --
> Martin Cooper
>
>
> We've reviewed our tomcat settings, and have not found anything that has
> > helped either--I was thinking that we might only be using one thread due
> > to
> > some mistaken configuration, but that is not the case.
> >
> > We see the CPU usage climb up to about 20% when dealing with large file
> > uploads, but it is no where near maxing our cpu usage on our dual xeons.
> >
> > -----Original Message-----
> > From: jwcarman@gmail.com [mailto:jwcarman@gmail.com] On Behalf Of James
> > Carman
> > Sent: Wednesday, October 25, 2006 1:07 PM
> > To: Jakarta Commons Users List; richk@talkshoe.com
> > Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users
> >
> > Are you saying that Tomcat isn't responding to any other of the same
> type
> > of
> > requests (other file uploads) or it's not responding to *any* requests
> at
> > all (even requests to other webapps within the same instance)?
> >
> > On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
> > >
> > > I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
> > > <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
> > >
> > >
> > >
> > > When a user uploads a file, tomcat becomes completely unresponsive to
> > any
> > > other requests until the upload is complete-this is the case no matter
> > > what
> > > the file size is 8K to 40MB.
> > >
> > >
> > >
> > > Watching garbage collection logging details, I see that the file
> upload
> > > component always seems to take at least 32MB or 42MB, and then it is
> > > quickly
> > > collected when the upload is completed, and the tomcat server is then
> > > available to everyone.
> > >
> > >
> > >
> > > I used the input stream from the
> > > org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream()
> call,
> > > and
> > > then write it out using the below method.
> > >
> > >
> > >
> > > Any ideas what would be causing tomcat to be non-responsive to any
> other
> > > request until the upload is finished?  Are there any configuration
> > tweeks
> > > that can made to help.  I have scanned the mail archives, wiki, and
> > > documentation without luck.  Perhaps I have missed something?
> > >
> > >
> > >
> > > Thanks.
> > >
> > >
> > >
> > > Rich K.
> > >
> > >
> > >
> >
> >
>
> ----------------------------------------------------------------------------
> > >
> > >
> >
> >
>
> ----------------------------------------------------------------------------
> > > ---------------------------------------------------
> > >
> > >
> > >
> > >       /**
> > >
> > >        * Write the given input stream to the given file identified by
> > the
> > > targetFilePath string.
> > >
> > >        * @param inputStream
> > >
> > >        * @param targetFilePath
> > >
> > >        * @throws IOException
> > >
> > >        */
> > >
> > >       public static void writeInputStreamToFile(InputStream
> inputStream,
> > > String targetFilePath) throws IOException {
> > >
> > >         InputStream in =
> > >
> > >             new BufferedInputStream(inputStream);
> > >
> > >         OutputStream out =
> > >
> > >             new FileOutputStream(targetFilePath);
> > >
> > >         try {
> > >
> > >             byte[] buffer = new byte[64 * 1024];
> > >
> > >             int count;
> > >
> > >             while ((count = in.read(buffer)) > 0) {
> > >
> > >                   out.write(buffer, 0, count);
> > >
> > >             }
> > >
> > >         } finally {
> > >
> > >             in.close();
> > >
> > >             out.close();
> > >
> > >         }
> > >
> > >       }
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

RE: fileupload makes tomcat 5.5 unresponsive for other users

Posted by Richard Koch <ri...@talkshoe.com>.
It sounds like it, but we are not using SingleThreadModel anywhere in our
code.  Also we do not set our JSPs to turn off threads either (which can be
done through <%@ page isThreadSafe="false" %>).

I have not started digging into the apache code yet; perhaps
SingleThreadModel is used in the file upload components...?

Someone mentioned the idea that this might also be a file io issue that
blocks the whole tomcat java process, but I have yet to prove that.

-----Original Message-----
From: mfncooper@gmail.com [mailto:mfncooper@gmail.com] On Behalf Of Martin
Cooper
Sent: Thursday, October 26, 2006 1:53 PM
To: Jakarta Commons Users List; richk@talkshoe.com
Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users

On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
>
> Unfortunately, tomcat is not responding to *any* requests until the upload
> completes.  After the upload, everything is fine.


This sounds a whole lot like you're using SingleThreadModel in the servlet
that's doing the upload.

--
Martin Cooper


We've reviewed our tomcat settings, and have not found anything that has
> helped either--I was thinking that we might only be using one thread due
> to
> some mistaken configuration, but that is not the case.
>
> We see the CPU usage climb up to about 20% when dealing with large file
> uploads, but it is no where near maxing our cpu usage on our dual xeons.
>
> -----Original Message-----
> From: jwcarman@gmail.com [mailto:jwcarman@gmail.com] On Behalf Of James
> Carman
> Sent: Wednesday, October 25, 2006 1:07 PM
> To: Jakarta Commons Users List; richk@talkshoe.com
> Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users
>
> Are you saying that Tomcat isn't responding to any other of the same type
> of
> requests (other file uploads) or it's not responding to *any* requests at
> all (even requests to other webapps within the same instance)?
>
> On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
> >
> > I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
> > <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
> >
> >
> >
> > When a user uploads a file, tomcat becomes completely unresponsive to
> any
> > other requests until the upload is complete-this is the case no matter
> > what
> > the file size is 8K to 40MB.
> >
> >
> >
> > Watching garbage collection logging details, I see that the file upload
> > component always seems to take at least 32MB or 42MB, and then it is
> > quickly
> > collected when the upload is completed, and the tomcat server is then
> > available to everyone.
> >
> >
> >
> > I used the input stream from the
> > org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call,
> > and
> > then write it out using the below method.
> >
> >
> >
> > Any ideas what would be causing tomcat to be non-responsive to any other
> > request until the upload is finished?  Are there any configuration
> tweeks
> > that can made to help.  I have scanned the mail archives, wiki, and
> > documentation without luck.  Perhaps I have missed something?
> >
> >
> >
> > Thanks.
> >
> >
> >
> > Rich K.
> >
> >
> >
>
>
----------------------------------------------------------------------------
> >
> >
>
>
----------------------------------------------------------------------------
> > ---------------------------------------------------
> >
> >
> >
> >       /**
> >
> >        * Write the given input stream to the given file identified by
> the
> > targetFilePath string.
> >
> >        * @param inputStream
> >
> >        * @param targetFilePath
> >
> >        * @throws IOException
> >
> >        */
> >
> >       public static void writeInputStreamToFile(InputStream inputStream,
> > String targetFilePath) throws IOException {
> >
> >         InputStream in =
> >
> >             new BufferedInputStream(inputStream);
> >
> >         OutputStream out =
> >
> >             new FileOutputStream(targetFilePath);
> >
> >         try {
> >
> >             byte[] buffer = new byte[64 * 1024];
> >
> >             int count;
> >
> >             while ((count = in.read(buffer)) > 0) {
> >
> >                   out.write(buffer, 0, count);
> >
> >             }
> >
> >         } finally {
> >
> >             in.close();
> >
> >             out.close();
> >
> >         }
> >
> >       }
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: fileupload makes tomcat 5.5 unresponsive for other users

Posted by Martin Cooper <ma...@apache.org>.
On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
>
> Unfortunately, tomcat is not responding to *any* requests until the upload
> completes.  After the upload, everything is fine.


This sounds a whole lot like you're using SingleThreadModel in the servlet
that's doing the upload.

--
Martin Cooper


We've reviewed our tomcat settings, and have not found anything that has
> helped either--I was thinking that we might only be using one thread due
> to
> some mistaken configuration, but that is not the case.
>
> We see the CPU usage climb up to about 20% when dealing with large file
> uploads, but it is no where near maxing our cpu usage on our dual xeons.
>
> -----Original Message-----
> From: jwcarman@gmail.com [mailto:jwcarman@gmail.com] On Behalf Of James
> Carman
> Sent: Wednesday, October 25, 2006 1:07 PM
> To: Jakarta Commons Users List; richk@talkshoe.com
> Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users
>
> Are you saying that Tomcat isn't responding to any other of the same type
> of
> requests (other file uploads) or it's not responding to *any* requests at
> all (even requests to other webapps within the same instance)?
>
> On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
> >
> > I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
> > <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
> >
> >
> >
> > When a user uploads a file, tomcat becomes completely unresponsive to
> any
> > other requests until the upload is complete-this is the case no matter
> > what
> > the file size is 8K to 40MB.
> >
> >
> >
> > Watching garbage collection logging details, I see that the file upload
> > component always seems to take at least 32MB or 42MB, and then it is
> > quickly
> > collected when the upload is completed, and the tomcat server is then
> > available to everyone.
> >
> >
> >
> > I used the input stream from the
> > org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call,
> > and
> > then write it out using the below method.
> >
> >
> >
> > Any ideas what would be causing tomcat to be non-responsive to any other
> > request until the upload is finished?  Are there any configuration
> tweeks
> > that can made to help.  I have scanned the mail archives, wiki, and
> > documentation without luck.  Perhaps I have missed something?
> >
> >
> >
> > Thanks.
> >
> >
> >
> > Rich K.
> >
> >
> >
>
> ----------------------------------------------------------------------------
> >
> >
>
> ----------------------------------------------------------------------------
> > ---------------------------------------------------
> >
> >
> >
> >       /**
> >
> >        * Write the given input stream to the given file identified by
> the
> > targetFilePath string.
> >
> >        * @param inputStream
> >
> >        * @param targetFilePath
> >
> >        * @throws IOException
> >
> >        */
> >
> >       public static void writeInputStreamToFile(InputStream inputStream,
> > String targetFilePath) throws IOException {
> >
> >         InputStream in =
> >
> >             new BufferedInputStream(inputStream);
> >
> >         OutputStream out =
> >
> >             new FileOutputStream(targetFilePath);
> >
> >         try {
> >
> >             byte[] buffer = new byte[64 * 1024];
> >
> >             int count;
> >
> >             while ((count = in.read(buffer)) > 0) {
> >
> >                   out.write(buffer, 0, count);
> >
> >             }
> >
> >         } finally {
> >
> >             in.close();
> >
> >             out.close();
> >
> >         }
> >
> >       }
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

RE: fileupload makes tomcat 5.5 unresponsive for other users

Posted by Richard Koch <ri...@talkshoe.com>.
Our preproduction server is just dual Xeon (not core).

Our production environment is using dual core Xeons.

The problems is reproducible on both systems.

We used 'top' to see the cpu usage.  It looked like only one CPU was being
taxed by the java process and it was 25-28% at peak.  The summary of CPU
usage (which I have been told includes both CPUs) was not that high.  

I believe the results were similar on both of our production and
preproduction systems.

Our systems guy was the one running and reviewing top as I was performing
the tests, so I did not see the top results 1st hand.  I can run another
test and gather more detailed information if it helps anyone help us.


-----Original Message-----
From: Michael Thomson [mailto:michael@canb.auug.org.au] 
Sent: Wednesday, October 25, 2006 3:09 PM
To: Jakarta Commons Users List
Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users

Are they are dual core Xeon's?  If they are 20-25% cpu usage is one of 
the cores fully utilized as it loads the large file.

Richard Koch wrote:
> Unfortunately, tomcat is not responding to *any* requests until the upload
> completes.  After the upload, everything is fine.
>
> We've reviewed our tomcat settings, and have not found anything that has
> helped either--I was thinking that we might only be using one thread due
to
> some mistaken configuration, but that is not the case.
>
> We see the CPU usage climb up to about 20% when dealing with large file
> uploads, but it is no where near maxing our cpu usage on our dual xeons.
>
> -----Original Message-----
> From: jwcarman@gmail.com [mailto:jwcarman@gmail.com] On Behalf Of James
> Carman
> Sent: Wednesday, October 25, 2006 1:07 PM
> To: Jakarta Commons Users List; richk@talkshoe.com
> Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users
>
> Are you saying that Tomcat isn't responding to any other of the same type
of
> requests (other file uploads) or it's not responding to *any* requests at
> all (even requests to other webapps within the same instance)?
>
> On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
>   
>> I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
>> <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
>>
>>
>>
>> When a user uploads a file, tomcat becomes completely unresponsive to any
>> other requests until the upload is complete-this is the case no matter
>> what
>> the file size is 8K to 40MB.
>>
>>
>>
>> Watching garbage collection logging details, I see that the file upload
>> component always seems to take at least 32MB or 42MB, and then it is
>> quickly
>> collected when the upload is completed, and the tomcat server is then
>> available to everyone.
>>
>>
>>
>> I used the input stream from the
>> org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call,
>> and
>> then write it out using the below method.
>>
>>
>>
>> Any ideas what would be causing tomcat to be non-responsive to any other
>> request until the upload is finished?  Are there any configuration tweeks
>> that can made to help.  I have scanned the mail archives, wiki, and
>> documentation without luck.  Perhaps I have missed something?
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Rich K.
>>
>>
>>
>>     
>
----------------------------------------------------------------------------
>   
>>     
>
----------------------------------------------------------------------------
>   
>> ---------------------------------------------------
>>
>>
>>
>>       /**
>>
>>        * Write the given input stream to the given file identified by the
>> targetFilePath string.
>>
>>        * @param inputStream
>>
>>        * @param targetFilePath
>>
>>        * @throws IOException
>>
>>        */
>>
>>       public static void writeInputStreamToFile(InputStream inputStream,
>> String targetFilePath) throws IOException {
>>
>>         InputStream in =
>>
>>             new BufferedInputStream(inputStream);
>>
>>         OutputStream out =
>>
>>             new FileOutputStream(targetFilePath);
>>
>>         try {
>>
>>             byte[] buffer = new byte[64 * 1024];
>>
>>             int count;
>>
>>             while ((count = in.read(buffer)) > 0) {
>>
>>                   out.write(buffer, 0, count);
>>
>>             }
>>
>>         } finally {
>>
>>             in.close();
>>
>>             out.close();
>>
>>         }
>>
>>       }
>>
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: fileupload makes tomcat 5.5 unresponsive for other users

Posted by Michael Thomson <mi...@canb.auug.org.au>.
Are they are dual core Xeon's?  If they are 20-25% cpu usage is one of 
the cores fully utilized as it loads the large file.

Richard Koch wrote:
> Unfortunately, tomcat is not responding to *any* requests until the upload
> completes.  After the upload, everything is fine.
>
> We've reviewed our tomcat settings, and have not found anything that has
> helped either--I was thinking that we might only be using one thread due to
> some mistaken configuration, but that is not the case.
>
> We see the CPU usage climb up to about 20% when dealing with large file
> uploads, but it is no where near maxing our cpu usage on our dual xeons.
>
> -----Original Message-----
> From: jwcarman@gmail.com [mailto:jwcarman@gmail.com] On Behalf Of James
> Carman
> Sent: Wednesday, October 25, 2006 1:07 PM
> To: Jakarta Commons Users List; richk@talkshoe.com
> Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users
>
> Are you saying that Tomcat isn't responding to any other of the same type of
> requests (other file uploads) or it's not responding to *any* requests at
> all (even requests to other webapps within the same instance)?
>
> On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
>   
>> I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
>> <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
>>
>>
>>
>> When a user uploads a file, tomcat becomes completely unresponsive to any
>> other requests until the upload is complete-this is the case no matter
>> what
>> the file size is 8K to 40MB.
>>
>>
>>
>> Watching garbage collection logging details, I see that the file upload
>> component always seems to take at least 32MB or 42MB, and then it is
>> quickly
>> collected when the upload is completed, and the tomcat server is then
>> available to everyone.
>>
>>
>>
>> I used the input stream from the
>> org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call,
>> and
>> then write it out using the below method.
>>
>>
>>
>> Any ideas what would be causing tomcat to be non-responsive to any other
>> request until the upload is finished?  Are there any configuration tweeks
>> that can made to help.  I have scanned the mail archives, wiki, and
>> documentation without luck.  Perhaps I have missed something?
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Rich K.
>>
>>
>>
>>     
> ----------------------------------------------------------------------------
>   
>>     
> ----------------------------------------------------------------------------
>   
>> ---------------------------------------------------
>>
>>
>>
>>       /**
>>
>>        * Write the given input stream to the given file identified by the
>> targetFilePath string.
>>
>>        * @param inputStream
>>
>>        * @param targetFilePath
>>
>>        * @throws IOException
>>
>>        */
>>
>>       public static void writeInputStreamToFile(InputStream inputStream,
>> String targetFilePath) throws IOException {
>>
>>         InputStream in =
>>
>>             new BufferedInputStream(inputStream);
>>
>>         OutputStream out =
>>
>>             new FileOutputStream(targetFilePath);
>>
>>         try {
>>
>>             byte[] buffer = new byte[64 * 1024];
>>
>>             int count;
>>
>>             while ((count = in.read(buffer)) > 0) {
>>
>>                   out.write(buffer, 0, count);
>>
>>             }
>>
>>         } finally {
>>
>>             in.close();
>>
>>             out.close();
>>
>>         }
>>
>>       }
>>
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


RE: fileupload makes tomcat 5.5 unresponsive for other users

Posted by Richard Koch <ri...@talkshoe.com>.
Unfortunately, tomcat is not responding to *any* requests until the upload
completes.  After the upload, everything is fine.

We've reviewed our tomcat settings, and have not found anything that has
helped either--I was thinking that we might only be using one thread due to
some mistaken configuration, but that is not the case.

We see the CPU usage climb up to about 20% when dealing with large file
uploads, but it is no where near maxing our cpu usage on our dual xeons.

-----Original Message-----
From: jwcarman@gmail.com [mailto:jwcarman@gmail.com] On Behalf Of James
Carman
Sent: Wednesday, October 25, 2006 1:07 PM
To: Jakarta Commons Users List; richk@talkshoe.com
Subject: Re: fileupload makes tomcat 5.5 unresponsive for other users

Are you saying that Tomcat isn't responding to any other of the same type of
requests (other file uploads) or it's not responding to *any* requests at
all (even requests to other webapps within the same instance)?

On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
>
> I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
> <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
>
>
>
> When a user uploads a file, tomcat becomes completely unresponsive to any
> other requests until the upload is complete-this is the case no matter
> what
> the file size is 8K to 40MB.
>
>
>
> Watching garbage collection logging details, I see that the file upload
> component always seems to take at least 32MB or 42MB, and then it is
> quickly
> collected when the upload is completed, and the tomcat server is then
> available to everyone.
>
>
>
> I used the input stream from the
> org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call,
> and
> then write it out using the below method.
>
>
>
> Any ideas what would be causing tomcat to be non-responsive to any other
> request until the upload is finished?  Are there any configuration tweeks
> that can made to help.  I have scanned the mail archives, wiki, and
> documentation without luck.  Perhaps I have missed something?
>
>
>
> Thanks.
>
>
>
> Rich K.
>
>
>
----------------------------------------------------------------------------
>
>
----------------------------------------------------------------------------
> ---------------------------------------------------
>
>
>
>       /**
>
>        * Write the given input stream to the given file identified by the
> targetFilePath string.
>
>        * @param inputStream
>
>        * @param targetFilePath
>
>        * @throws IOException
>
>        */
>
>       public static void writeInputStreamToFile(InputStream inputStream,
> String targetFilePath) throws IOException {
>
>         InputStream in =
>
>             new BufferedInputStream(inputStream);
>
>         OutputStream out =
>
>             new FileOutputStream(targetFilePath);
>
>         try {
>
>             byte[] buffer = new byte[64 * 1024];
>
>             int count;
>
>             while ((count = in.read(buffer)) > 0) {
>
>                   out.write(buffer, 0, count);
>
>             }
>
>         } finally {
>
>             in.close();
>
>             out.close();
>
>         }
>
>       }
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: fileupload makes tomcat 5.5 unresponsive for other users

Posted by James Carman <ja...@carmanconsulting.com>.
Are you saying that Tomcat isn't responding to any other of the same type of
requests (other file uploads) or it's not responding to *any* requests at
all (even requests to other webapps within the same instance)?

On 10/25/06, Richard Koch <ri...@talkshoe.com> wrote:
>
> I am using the commons fileupload 1.1.1 along with the JSP/JSF tag
> <t:inputFileUpload> tag.  Out application server is Tomcat 5.5.
>
>
>
> When a user uploads a file, tomcat becomes completely unresponsive to any
> other requests until the upload is complete-this is the case no matter
> what
> the file size is 8K to 40MB.
>
>
>
> Watching garbage collection logging details, I see that the file upload
> component always seems to take at least 32MB or 42MB, and then it is
> quickly
> collected when the upload is completed, and the tomcat server is then
> available to everyone.
>
>
>
> I used the input stream from the
> org.apache.myfaces.custom.fileupload.UploadedFile.getInputStream() call,
> and
> then write it out using the below method.
>
>
>
> Any ideas what would be causing tomcat to be non-responsive to any other
> request until the upload is finished?  Are there any configuration tweeks
> that can made to help.  I have scanned the mail archives, wiki, and
> documentation without luck.  Perhaps I have missed something?
>
>
>
> Thanks.
>
>
>
> Rich K.
>
>
> ----------------------------------------------------------------------------
>
> ----------------------------------------------------------------------------
> ---------------------------------------------------
>
>
>
>       /**
>
>        * Write the given input stream to the given file identified by the
> targetFilePath string.
>
>        * @param inputStream
>
>        * @param targetFilePath
>
>        * @throws IOException
>
>        */
>
>       public static void writeInputStreamToFile(InputStream inputStream,
> String targetFilePath) throws IOException {
>
>         InputStream in =
>
>             new BufferedInputStream(inputStream);
>
>         OutputStream out =
>
>             new FileOutputStream(targetFilePath);
>
>         try {
>
>             byte[] buffer = new byte[64 * 1024];
>
>             int count;
>
>             while ((count = in.read(buffer)) > 0) {
>
>                   out.write(buffer, 0, count);
>
>             }
>
>         } finally {
>
>             in.close();
>
>             out.close();
>
>         }
>
>       }
>
>
>