tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Problems uploading huge files >2GB to Tomcat app.
Date Tue, 10 Apr 2012 12:39:19 GMT
2012/4/10 Nick Porter <nick.porter@tradar.com>:
>
> Hi all. New to Tomcat and not a developer but I have been trying to deploy a website
using Debian6, Tomcat 6.0.35 hosting the OpenCMS 8.0.1 app. The website and the OpenCMS app
has a facility to upload files however I only seem to be able to upload files that are less
than 2GB. I did read that there used to be a 2GB bug in Tomcat a few versions ago but that
this had since been resolved.
>
> The errors I am seeing are a mixture of  400 Bad Request and 413 Request Entity too
Large.
>
> I'm connecting directly to Tomcat and the app/site on the HTTP/1.1 connector, port 8080.
>
> I could be wrong but I can't see anything untoward in the logs located at /var/log/tomcat6/
>
> The chaps over at the OpenCMS mail list assure me that OpenCMS is capable of handling
files of this size so I'm guessing my Tomcat config is in some way causing the problem.
>
> I've expanded the memory for the heap in the /etc/defaults/tomcat6 file with;
>
> JAVA_OPTS="-Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC"
>
> ...and added the maxPostSize="0" to the HTTP connector but I'm still see these errors.
>
> Here's my connector settings from server.xml
>
>    <Connector port="8080" protocol="HTTP/1.1"
>               connectionTimeout="20000"
>               URIEncoding="UTF-8"
>               maxPostSize="0"
>               redirectPort="8443" />
>
> The only other settings I found relating to the size of a POST were the packetSize attribute
but believe this is only relevant to the AJP connector.
>
> I'm at a loss as to what to try next so have come here as a last resort. Can anybody
give me any pointers or advice on how I can further investigate and resolve this problem?
>

1. Tomcat 6 does not handle file upload by itself (if you are using
Content-Type="multipart/form-data"). It can only provide
request.getInputStream() and something else has to consume it.

Usually that will be Apache Commons Fileupload library, but you will
have to check what OpenMS uses.

I do not remember what default configuration of Fileupload library is.
Certainly such big files have to go into a temporary folder, but I do
not remember whether it is configured by default.  Tomcat startup
script sets java.io.tmpdir property to point to "$CATALINA_BASE/temp".

Are you able to upload big files that are more than 512Mb, but less than 2Gb?

The file upload form - does it come from OpenCMS?


2. It is possible to configure "connectionUploadTimeout" and
"disableUploadTimeout" on a Connector. I cannot say for sure how much
relevant are they  to those 400 and 413 errors.

Do 400 vs 413 errors change randomly?


3. If FORM authentication is used, it usually saves request before
displaying the login form.  This request is saved in memory and its
size is very limited (several Kb).

If your session expires when you submit your file I think you will see
an error because of that limit.


4. If file size is >2Gb then the method
"response.setContentLength(int)" cannot be used. One has to use
response.setHeader("Content-Length", Long.toString(length));  That is
the only thing in API that I remember that is relevant to handling
files > 2Gb.


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message