Server Performance Throw more $$ at this problem, hardware is cheap, compared to people (aka wetware).
It would be highly unusual for the TDS not to be I/O bound, so buying a high-performance disk subsystem is much better than buying fast CPUs. Slower, more energy efficient multicore processors are optimized for web server loads.
Typically disk access is faster on a local drive than on an NFS mounted drive. High performance disk subsystems like RAID or SANs can also significantly improve TDS throughput. You might also consider ZFS software RAID.
If you have system admin resources, examine the possible file systems available for your OS, eg on Linux or Solaris. We are using the ZFS file system on Solaris-X86 and it is very fast. We use ZFS software RAID, which replaces hardware RAID.
The OS typically limits the number of open file handles per process. To check this value on Unix, use:
ulimit -n
If you are using the default TDS configuration values, this value should be 1024 or greater. Otherwise you can tune this number based on your own settings. For example, to set this value to 2048 in the tomcat startup.sh script:
ulimit -n 2048
This affects the number of files to keep in the NetcdfFile cache.
We recommend the latest version of JDK 1.6, which has typically a 20% performance improvement or more over 1.5, especially with the -server option.
To do so, set the Java runtime parameters with the environmental variable JAVA_OPTS. For example, add the following to ${tomcat_home}/bin/startup.sh :
JAVA_OPTS="-server -Xmx1024m -Xms256m" export JAVA_OPT
starts Tomcat with the Server JVM, and gives it 256 Mbytes of memory to start with, and allows a maximum of 1024 Mbytes. These are suggested numbers, use more if you can. The maximum you can use for 32-bit JVMs seems to be around 1500m. You need to restart Tomcat for these options to take effect.
We have not yet had a chance to compare performance of 32-bit vs 64-bit JVMs. However, 64-bit JVMs allow the use of much larger memory heaps, which will help for highly loaded systems.
We recommend the latest stable version of Tomcat 6, which has better stability and performance than Tomcat 5.x. This requires JDK 1.5 or above.
Tomcat can be configured to automatically compress the responses, whenver the client accespts that. Compression is usually a big win, especially for bandwidth-limited sites. Deciding when and what to compress depends on a lot of factors, however. We use the following settings in server.xml:
<!-- non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080"
protocol="HTTP/1.1"
maxThreads="50"
connectionTimeout="20000"
redirectPort="8443"
compression="1000"
compressableMimeType="text/html,text/xml,text/plain,application/octet-stream" />
This says to compress (gzip or deflate) when the number of bytes is >= 1000, for the named mime-types. See Tomcat HTTP Connector reference page for more details.
In a production environment, Tomcat should be automatically restarted when the machine starts. How to do this depends on what OS you are running. This FAQ has a bit of info.
Once thredds.war is expanded, manually copy everything in ${tomcat_home}/webapps/thredds/initialContent/root/ to ${tomcat_home}/webapps/ROOT/ .
The TDS caches file handles to minimize OS overhead. Currently this defaults to allow 200 - 400 open files for OPeNDAP and WCS, and 25 - 40 for HTTP file serving. This means that your OS must allow at least that many file handles per process, otherwise you can get a "out of file handles" message, and the server can freeze up.
These numbers limit performance, but not functionality. For example, the number of files in an aggregation is not limited by these file handle limits.
You can change these settings in the threddsConfig.xml file.
Each NetcdfFile object encapsolates a file. NcML aggregations are careful not to keep constituent files open. When number of cache files > maxElementsInMemory, a cleanup thread starts after 100 msecs. So the number of cached files can get larger than maxElementsInMemory in the interim, but unless you are really hammering the OS by opening many files per scond, it shouldnt get too much bigger. But leave some cushion, depending on your expected rate of opening files.
The TDS writes temporary files and caches files. By default these are stored under ${tomcat_home}/content/thredds/. These directories can get large. You might want to relocate them to another place, for example if ${tomcat_home} has limited space. Also, theres no need to backup the cache directories, so they can be placed on a disk that is not backup up. To move these directories, see TDS Configuration with threddsConfig.xml.
The OPeNDAP-Java layer of the server currently has to read the entire data request into memory before sending it to the client (we hope to get a streaming I/O solution working eventually). Generally clients only request subsets of large files, but if you need to support large data requests, make sure that the -Xmx parameter above is set accordingly.
If you are serving GRIB files through any of the subsetting services (OPENDAP, WCS, etc), the CDM must write an index the first time it tries to read it. This can take several minutes for very large GRIB files. By indexing GRIB files before they are accessed, users get much faster response time.
This document is maintained by John Caron and was last updated July 2009