comparison doc/src/site/markdown/java-settings.md @ 1396:7a2de95a7b8e

documentation updated with Ubbo's codec tuning tips and IIIF API info.
author robcast
date Fri, 09 Oct 2015 16:45:40 +0200
parents bd7dfa8b164e
children 3e2f71bafcfb
comparison
equal deleted inserted replaced
1395:4c72696fcc96 1396:7a2de95a7b8e
1 # Java VM settings for digilib 1 # Java VM memory settings for digilib
2
3 (Robert Casties, September 2013)
2 4
3 The Java virtual machine (Java-VM) only uses a fixed amount of memory for 5 The Java virtual machine (Java-VM) only uses a fixed amount of memory for
4 its operations. When an operation needs more memory than available it aborts 6 its operations. When an operation needs more memory than available it aborts
5 with an error ("out of memory error"). 7 with an error ("out of memory error").
6 8
19 bottom of the web page `/server/dlConfig.jsp` in your digilib instance (e.g. 21 bottom of the web page `/server/dlConfig.jsp` in your digilib instance (e.g.
20 <http://localhost:8080/digilib/server/dlConfig.jsp> 22 <http://localhost:8080/digilib/server/dlConfig.jsp>
21 23
22 # Installing JAI ImageIO 24 # Installing JAI ImageIO
23 25
26 (Robert Casties, September 2013)
27
24 In principle you should be able to install the 28 In principle you should be able to install the
25 [Java Advanced Imaging](http://java.sun.com/javase/technologies/desktop/media/jai/) JAI-ImageIO 29 [Java Advanced Imaging](http://java.sun.com/javase/technologies/desktop/media/jai/) JAI-ImageIO
26 JAR file `jai_imageio.jar` (and native 30 JAR file `jai_imageio.jar` (and native
27 library files if available) in the `/WEB-INF/lib/` directory of the 31 library files if available) in the `/WEB-INF/lib/` directory of the
28 digilib web application as part of the default installation. 32 digilib web application as part of the default installation.
36 the libraries and I found that in some cases digilib stopped reading TIFF files 40 the libraries and I found that in some cases digilib stopped reading TIFF files
37 after a period of running. In these cases it helped to install the JAI files in 41 after a period of running. In these cases it helped to install the JAI files in
38 Tomcats `lib/` directory or globally in the local Java JDK 42 Tomcats `lib/` directory or globally in the local Java JDK
39 installation (i.e. in the Java's 'jre/lib/ext/' directory on linux). 43 installation (i.e. in the Java's 'jre/lib/ext/' directory on linux).
40 44
41 # Sample setup 45 # Codec availability and Performance
42 46
43 The current digilib setup at the MPIWG (as of December 2010): 47 (Ubbo Veentjer, Oct 2015)
44 48
45 * One frontend server running the lightweight web-multiplexer [pound](http://www.apsis.ch/pound/) 49 The number of image formats, which digilib may read or write, but also the performance of operating on this image formats depends on the ImageIO readers and writers available on the classpath.
46 on port 80 that distributes requests to three servers runnning digilib 50
47 * the three servers run digilib under [Jetty](http://www.eclipse.org/jetty/) on port 8080 without Apache 51 Working with larger images in JPEG format we experienced a big performance difference using different implementations of the JPEG readers/writers. OpenJDK-7 for example brings rather slow JPEG codecs, OpenJDK-8 operates much quicker on JPEG images, relying on libjpeg-turbo for this file format. Also the official Oracle-JDKs may include faster native codecs.
48 * one server is the frontend server (Linux 32bit, Dual 2.4GHz Xeon, 2GB RAM) 52
49 * the other server is a separate, newer machine (Linux 64bit, Dual 1.8GHz Opteron, 2GB RAM) 53 Some drop-in replacements for the native codecs are:
50 * the third server is a separate, newer machine (Linux 32bit, Dual 2.8GHz Xeon, 4GB RAM) 54
51 * the digilib instances (digilib 2.0b1 as of 12.12.2011) run on Jetty 8.0.4 on Java 55 * https://github.com/geosolutions-it/imageio-ext
52 1.6.0_26 with 1GB of Java VM memory for digilib (-Xmx1024m) with JAI (1.1.3) and JAI-ImageIO (1.1) 56 * https://github.com/haraldk/TwelveMonkeys
53 installed in `Jetty/lib/ext` 57
54 * both digilib servers access all image files over NFS (over GBit Ethernet) from a central file server 58 if these jar files are availabe on the classpath, the codecs may be used by digilib. To add them the jar files could e.g. be placed in the lib directory of tomcat or addded as a dependency to the digilib maven project.
55 (Solaris 10, Sun Fire 240, multiple RAIDs on Fibrechannel) 59
60 The actual codec implementation used is logged by digilib in debug mode, e.g.
61
62 1564059 [http-apr-9092-exec-4] DEBUG digilib.image.DocuImage - ImageIO: this reader: class com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader
63
64 # Codec performance
65
66 (Ubbo Veentjer, Oct 2015)
67
68 In our tests comparing the performance of OpenJDK7, OpenJDK8, imageio-ext and TwelveMonkeys codecs we experienced the following numbers for decoding, encoding and scaling a 4968px*5968px to 50% size:
69
70 24801 ms - OpenJDK7
71 11507 ms - OpenJDK7 with com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader
72 4216 ms - OpenJDK7 with imageio-ext using libjpeg-turbo
73 3635 ms - OpenJDK8
74
75 This numbers may depend on the actual implementation used, the processing power of the CPU and many other factors, to this are just meant to be a rough hint.
76
77 For using imageio-ext, the native library needs to be
78 available with the LD_LIBRARY_PATH environment variable (compare: https://github.com/geosolutions-it/imageio-ext/wiki/TurboJPEG-plugin), also the .jar archives need to be on the classpath.
79
80 For using the TwelveMonkey Codecs we added the following jars to the tomcat lib directory, which were retrieved by maven (dependency on imageio-jpeg-3.1.2):
81
82 * common-image-3.1.2.jar
83 * common-lang-3.1.2.jar
84 * imageio-jpeg-3.1.2.jar
85 * common-io-3.1.2.jar
86 * imageio-core-3.1.2.jar
87 * imageio-metadata-3.1.2.jar
88
89
90 # Codec availability
91
92 (Ubbo Veentjer, Oct 2015)
93
94 Digilib logs on startup which image formats are supported, e.g:
95
96 9763 [localhost-startStop-1] INFO digilib.conf.DigilibConfiguration - DocuImage supported image formats: raw, jpeg, tif, WBMP, pcx, PNM, JPG, wbmp, JPEG, PNG, jpeg 2000, tiff, BMP, JPEG2000, RAW, jpeg2000, GIF, TIF, TIFF, bmp, jpg, PCX, pnm, png, gif,
97
98 by adding e.g. TwelveMonkeys or image-io ext codecs, more codecs could become available.
99
100