annotate website/java-settings.md @ 6:96e83fba5eb7

more markdown docs.
author casties
date Fri, 30 Aug 2013 19:00:19 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
1 # Java VM settings for digilib
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
2
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
3 The Java virtual machine (Java-VM) only uses a fixed amount of memory for
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
4 its operations. When an operation needs more memory than available it aborts
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
5 with an error ("out of memory error").
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
6
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
7 digilib can need a lot of memory depending on the size and type of images.
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
8 Since digilib runs as a servlet under Tomcat its in the same VM as the Tomcat
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
9 server.
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
10
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
11 The amount of memory Tomcat (version 5.0) uses is configured by creating a
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
12 "setenv.sh" script with a line
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
13
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
14 CATALINA_OPTS="-Xmx512m"
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
15
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
16 in Tomcat's `bin` directory (giving 512MB in this case).
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
17
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
18 You can check the amount of memory your digilib instance has available on the
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
19 bottom of the web page `/server/dlConfig.jsp` in your digilib instance (e.g.
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
20 [http://digilib.mpiwg-berlin.mpg.de/digitallibrary/server/dlConfig.jsp](http://digilib.mpiwg-berlin.mpg.de/digitallibrary/server/dlConfig.jsp)).
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
21
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
22 # Installing JAI ImageIO
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
23
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
24 In principle you should be able to install the
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
25 [Java Advanced Imaging](http://java.sun.com/javase/technologies/desktop/media/jai/) JAI-ImageIO
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
26 JAR file `jai_imageio.jar` (and native
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
27 library files if available) in the `/WEB-INF/lib/` directory of the
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
28 digilib web application as part of the default installation.
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
29
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
30 You can see if the Jai-ImageIO plugin is active by checking for the
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
31 availability of the TIFF image format under "Supported image types" on the
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
32 [`/server/dlConfig.jsp`](http://digilib.mpiwg-berlin.mpg.de/digitallibrary/server/dlConfig.jsp)
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
33 status page.
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
34
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
35 But sometimes there are classloader issues. Newer versions of Tomcat refuse to load
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
36 the libraries and I found that in some cases digilib stopped reading TIFF files
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
37 after a period of running.
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
38
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
39 In these cases it helped to install the JAI files in Tomcats `lib/`
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
40 directory or globally in the local Java JDK
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
41 installation (i.e. in the Java's 'jre/lib/ext/' directory on linux).
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
42
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
43 # Sample setup
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
44
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
45 The current digilib setup at the MPIWG (as of December 2010):
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
46
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
47 * One frontend server running the lightweight web-multiplexer [pound](http://www.apsis.ch/pound/)
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
48 on port 80 that distributes requests to three servers runnning digilib
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
49 * the three servers run digilib under [Jetty](http://www.eclipse.org/jetty/) on port 8080 without Apache
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
50
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
51 * one server is the frontend server (Linux 32bit, Dual
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
52 2.4GHz Xeon, 2GB RAM)
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
53 * the other server is a separate, newer machine (Linux 64bit, Dual 1.8GHz
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
54 Opteron, 2GB RAM)
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
55 * the third server is a separate, newer machine (Linux 32bit, Dual 2.8GHz
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
56 Xeon, 4GB RAM)
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
57 * the digilib instances (digilib 2.0b1 as of 12.12.2011) run on Jetty 8.0.4 on Java
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
58 1.6.0_26 with 1GB of [Java VM memory
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
59 for digilib](#vm_settings) (-Xmx1024m) with JAI (1.1.3) and JAI-ImageIO (1.1) [installed in the Jetty/lib/ext](#installing_jai)(!)
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
60 * both digilib servers access all image files over NFS (over GBit
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
61 Ethernet) from a central file server (Solaris 10, Sun Fire 240, multiple RAIDs
96e83fba5eb7 more markdown docs.
casties
parents:
diff changeset
62 on Fibrechannel)