[opencms-dev] Max File Upload Size

Rüdiger Kurz r.kurz at alkacon.com
Thu Apr 19 16:33:11 CEST 2012


Hi Nick,

now we are getting in a more "consulting" task that is not part of my 
scope of action. But anyway 'decoupled DB' is not a concept of OpenCms. 
Moreover I was thinking about putting all the huge files (don't know how 
much you have and if they are hierarchically ordered) in a folder inside 
tomcat (e.g. <TOMCAT_HOME>\webapps\opencms\myVideos) and define a custom 
XML resource type (XSD Schema) for OpenCms that stores a reference on 
one or more binary files (e.g. videos). That would enable you to use the 
power of OpenCms (JSP/Servlet-Tech, Templating, Navigation builder, 
Properties, Search, Content-Relation-Engine, ...) and 
providing/referring the huge files that will be delivered directly from 
the real file system.

I don't know your application in detail and it would go beyond the scope 
of this discussion. But the point I want to make is: You have a 
Linux/SQL/Apache/Tomcat/OpenCms architecture and it should be possible 
to store the files in the real file system and refer them from the 
OpenCms context.

Consider to:
- use apache rewrite rules that will deliver the files or
- make use of /system/shared/linkexcludes
- create a custom XSD that represents a file on the RFS
- develop a OpenCms widget to link a files outside OpenCms

-Rüdiger


> Thanks for following up with this issue Rüdiger, it's much appreciated! At least this finally resolves for me the problem in as far as I now know that it's not the Apache/Tomcat configs that are causing it.
> Your suggestion to use a 'decoupled DB', Apologies for being hard of thinking but is this something that can be transparently coded within OpenCMS or will the byte array limitation you mentioned require this functionality to be completely separated from the website we host in it?
> --
> np
>
> Hi Nick,
>
> I did some research with the following results:
>
> OpenCms internally handles content as byte array. A byte[] with size of
> the maximum 32-bit signed integer would require 2GB of contiguous
> address space. So with a byte[] the maximum memory you can address is
> 2G. For this reason files larger than 2G can not be uploaded.
>
> For those files, that are smaller than 2G but larger than the heap space
> of your JVM a out of memory exception will be thrown and the upload
> hangs up. So if you want to upload a 2G file the heap space of the
> tomcat's JVM has to be large enough.
>
> In general you should consider to use a decoupled data storage
> (catchword: Multimedia Databases) for huge files. Typically you store
> the binary data on the real file system and the meta data inside the
> database.
>
> - Rüdiger

-- 
Kind Regards,
Rüdiger.

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

Visit OpenCms Days 2012 Conference and Expo September 24 to 25, 2012 in 
Cologne, Germany http://www.opencms-days.org

Rüdiger Kurz

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org



More information about the opencms-dev mailing list