comparison webapp/doc/website/tips.html @ 922:8251cc7888fb

slightly updated website. removed links to berlios wiki, made tips page instead. still quite ugly...
author robcast
date Fri, 09 Dec 2011 20:33:24 +0100
parents
children 45effb9c9bed
comparison
equal deleted inserted replaced
921:a00114a0c957 922:8251cc7888fb
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <title>digilib -- Digital Image Library</title>
7 </head>
8 <body>
9 <table border="0" cellspacing="0" cellpadding="10">
10 <tr>
11 <td bgcolor="#a0a0a0">&nbsp;</td>
12 <td>
13 <img src="images/digilib-logo-big.png" align="left" />
14 <h1>
15 <tt>digilib</tt>
16 -- a versatile image viewing environment for the internet
17 </h1>
18 </td>
19 </tr>
20 <tr>
21 <td bgcolor="#a0a0a0" valign="top" align="right">
22 <p>
23 <b><a href="index.html">Info</a>
24 </b>
25 </p>
26 <p>
27 <b><a href="http://developer.berlios.de/projects/digilib/">Project</a>
28 </b>
29 </p>
30 <p>
31 <b><a href="http://developer.berlios.de/project/showfiles.php?group_id=251">Download</a>
32 </b>
33 </p>
34 <p>
35 <b><a href="http://developer.berlios.de/docman/?group_id=251">Docs</a>
36 </b>
37 </p>
38 <p>
39 <b><a href="tips.html">Tips</a>
40 </b>
41 </p>
42 <p>
43 <b><a href="http://hg.berlios.de/repos/digilib">Source</a>
44 </b>
45 </p>
46 </td>
47 <td>
48
49
50 <p>Some tips for running digilib</p>
51 <ul>
52 <li>
53 <a href="#vm_settings">Java VM settings for digilib</a>
54 </li>
55 <li>
56 <a href="#prescaled_images">Prescaled images</a>
57 </li>
58 <li>
59 <a href="installing_jai">Installing JAI</a>
60 </li>
61 </ul>
62
63 <h1 id="vm_settings">Java VM settings for digilib</h1>
64
65 <p>The Java virtual machine (Java-VM) only uses a fixed amount of memory for
66 its operations. When an operation needs more memory than available it aborts
67 with an error ("out of memory error").</p>
68 <p>digilib can need a lot of memory depending on the size and type of images.
69 Since digilib runs as a servlet under Tomcat its in the same VM as the Tomcat
70 server.</p>
71 <p>The amount of memory Tomcat (version 5.0) uses is configured by creating a
72 "setenv.sh" script with a line</p>
73 <pre> CATALINA_OPTS="-Xmx512m"
74 </pre>
75 <p>in Tomcat's "bin" directory (giving 512MB in this case).</p>
76 <p>
77 You can check the amount of memory your digilib instance has available on the
78 bottom of the web page /server/dlConfig.jsp in your digilib instance (e.g. <a
79 href="http://digilib.mpiwg-berlin.mpg.de/digitallibrary/server/dlConfig.jsp"
80 class="external free" rel="nofollow">http://digilib.mpiwg-berlin.mpg.de/digitallibrary/server/dlConfig.jsp</a>).
81 </p>
82
83 <h1 id="prescaled_images">Prescaled images</h1>
84
85 <p>You can provide any number of scaled-down versions of your images that
86 digilib uses when a smaller version of an image is requested. Since less data
87 has to be read and processed this can speed up digilib's performance quite a
88 lot.</p>
89 <p>The actual process is that the client requests a certain target size,
90 digilib scans all available scaled-down versions of the same image, selects the
91 smallest image that is larger than the requested size and scales it down to the
92 requested size.</p>
93 <p>The scaled-down versions of the image have to have the same file name as
94 the original hi-res file. They can have a different type and extension (e.g.
95 img002.jpg for img002.TIFF)</p>
96 <p>The scaled down images have to be in the same subdirectory (the part that
97 shows up in digilib's "fn" parameter) as the hi-res file. The first part of each
98 directory tree is configured by the basedir-list parameter in
99 digilib-config.xml.</p>
100 <p>The sequence of directories in basedir-list is from hi-res to lo-res.
101 Images must be present in the hires directory but they need not be present in
102 all lower-res directories.</p>
103 <p>e.g. if digilib-config.xml contains</p>
104 <pre> &lt;parameter name="basedir-list" value="/images:/scaled:/thumb" /&gt;
105 </pre>
106 <p>and a user requests the image "books/book1/page0002" digilib looks for</p>
107 <pre> /thumb/books/book1/page0002.*
108 /scaled/books/book1/page002.*
109 /images/books/book1/page002.*
110 </pre>
111 <p>and uses the first image that is bigger than or equal to the requested
112 size.</p>
113 <p>
114 For batch-prescaling our images we use a script called "scale-o-mat" that uses a
115 lot of freely available imaging libraries (ImageMagick, libtiff, netpbm) and is
116 available in our public CVS <a
117 href="http://itgroup.mpiwg-berlin.mpg.de/cgi-bin/cvsweb.cgi/scaleomat/"
118 class="external autonumber" rel="nofollow">[1]</a>. The script is given a
119 hi-res base directory, a destination base directory, a destination size and a
120 starting directory. It then processes all files in the starting directory and
121 all its subdirectories and creates scaled images in corresponding directories
122 under the destination base directory.
123 </p>
124 <p>We currently use prescaled thumbnails of 100 pixels and images for browser
125 display of 1500 pixels. Remember that the prescaled image has to be larger (or
126 the same size) than the requested image size!</p>
127 <p>There is another optimization in digilib: if the requested image is exactly
128 the same size and type as the prescaled image then the prescaled image is sent
129 unmodified to the client which is a lot faster. So it makes sense to produce
130 thumbnails of exactly 90 pixels width when they are used in an HTML page where
131 all images are 90 pixels wide.</p>
132
133
134 <h1 id="installing_jai">Installing JAI</h1>
135
136 <p>
137 In principle you can install the <a
138 href="http://java.sun.com/javase/technologies/desktop/media/jai/"
139 class="external text" rel="nofollow">Java Advanced Imaging</a> JAR files (and
140 native library files if available) in the /WEB-INF/lib/ directory of the digilib
141 web application.
142
143 </p>
144 <p>I found that in some cases digilib stopped reading TIFF files after a
145 period of running. In these cases it helped to install the JAI files directly in
146 the local Java installation (i.e. in the Java's /jre/lib/ext/ directory on
147 linux).</p>
148
149
150 <h1 id="mpiwg_setup">Sample setup</h1>
151
152 <p>The current digilib setup at the MPIWG (as of November 2005):</p>
153 <ul>
154 <li>
155 One frontend server running the lightweight web-multiplexer <a
156 href="http://www.apsis.ch/pound/" class="external text" rel="nofollow">pound</a>
157 on port 80 that distributes requests to two servers runnning digilib
158 </li>
159 <li>
160 the two servers run digilib under <a
161 href="http://tomcat.apache.org/index.html" class="external text"
162 rel="nofollow">Tomcat</a> on port 8080 without Apache
163 <ul>
164 <li>one server is the same machine as the frontend server (Linux, Dual
165 2.4GHz Xeon, 2GB RAM)</li>
166 <li>the other server is a separate, newer machine (Linux, Dual 1.8GHz
167 Opteron, 2GB RAM)</li>
168 </ul>
169 </li>
170 <li>
171 the digilib instances (digilib 1.5.9c as of 22.11.2005) run on Tomcat on Java
172 1.5.0_05 (or 1.4.2_06) with 1GB of <a href="#vm_settings">Java VM memory
173 for digilib</a> (-Xmx1024m) with JAI (1.1.2_01) and JAI-ImageIO (1.0_01) <a
174 href="#installing_jai">installed in the JRE</a>(!)
175 </li>
176 <li>both digilib servers access all image files over NFS (over GBit
177 Ethernet) from a central file server (Solaris 8, Sun Fire 480, multiple RAIDs
178 on Fibrechannel)</li>
179 </ul>
180
181 </td>
182 </tr>
183 <tr>
184 <td style="padding: 0px" align="left">
185 <a href="http://developer.berlios.de"> <img
186 src="http://developer.berlios.de/bslogo.php?group_id=0&type=1" width="124"
187 height="32" border="0" alt="BerliOS Logo" /> </a>
188 </td>
189 <td></td>
190 </tr>
191 </table>
192
193 </body>
194 </html>