|
The process of tuning Sakai is very similar to tuning other J2EE applications, though Sakai generally requires a number of particular tunings to run and perform well. Note: many of the example settings are Sun JVM specific (as it is far and away the most popular JVM used in the Sakai community) – though most JVM implementations have similar settings/concepts. Server VMSun JVMs actually have 2 implementations, a client and server. The server implementation takes somewhat longer to start up, and consumes additional memory, but generally performs better. As of JDK 1.5? most "server-class" machines (multiple CPU, large amount of RAM) will generally automatically choose the server VM, though you can explicitly select it by using: -server 32-bit vs 64-bit JVMs32 bit OS's (by nature of having only 32 bits to address memory) can only provide your Java process with 4 GB of virtual address space. In reality this may result in a maximum JVM allocation as small as 2 GB, (on some systems the other 2 GB is reserved for the OS) Further, this 2 GB is allocated between various things (e.g. Permgen, Headers, Heap), so the heap may get only about 1.6 GB. A number of the objects allocated during normal Sakai operations may be quite large – as a result, a 32-bit JVM may not be capable of addressing enough memory to support a large number of concurrent users. A 64-bit JVM (requiring a 64-bit OS) is recommended for running Sakai Permgen AllocationThe permanent generation is where Java allocates class definitions among other things – and is often not subject to garbage collection. Due to the large number of components and generated classes used in Sakai, the default value (64MB on most systems) is often insufficient. Depending on the mix of tools and components you have installed, the maximum value for this space should probably be at least 128MB, possibly 256MB or higher. e.g. -XX:MaxPermSize=256m You may also wish to fix the allocation of this PermGen space to increase predictability for memory footprint, and reduce the likelyhood of a performance impact from a poorly timed resize operation. e.g. -XX:PermSize=256m -XX:MaxPermSize=256m Heap SizingAs a server application, to handle many concurrent users you will want to generously allocate RAM. Again depending on workload, institutions have had success with heap sizes ranging from 1.5-13GB in size. -Xmx1600m This is another area where you may wish to fix (min & max) size of the memory allocation to gain predictability and prevent resizing. -Xms1600m -Xmx1600m Memory AllocationsIn the generational memory model (used on all major JVMs) you may also see benefits from adjusting the allocation of memory regions (particularly your new, eden, and survivor spaces) Garbage Collection Strategy/ImplementationsSun JVMs have a number of different garbage collection strategies tuned for particular workflows. While the default settings have gotten better with each generation, your individual workloads may benefit from tuning. Community members have had success with both ConcurrentMarcSweep and ParallelGC. -XX:+UseParallelGC or -XX:+UseConcMarkSweepGC You can also tune collection in the New generation: see http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html LoggingA key aspect of performance tuning the JVM is having visibility into memory allocations and garbage collection statistics. There are a number of mechanisms for retriving this data: VerboseGC log: -verbose:gc -Xloggc:/apps/www/content/logs/content_gc.log
jstat: jstat |
More Sakai tuning documentation References
|
Comments (2)
Jan 12, 2007
Stephen Marquard says:
Here is a helpful article on thread stack space (relevant for 32bit servers), co...Here is a helpful article on thread stack space (relevant for 32-bit servers), courtesy of Bas Toeter:
http://goobsoft.homeip.net/Wiki.jsp?page=JavaDebianTuning
Dec 11, 2007
Jon Gorrono says:
WRT the server flag, this has historically been automagically invoked when a 'se...WRT the -server flag, this has historically been automagically invoked when a 'server-class machine' is detected as the host by the jvm. I think the limit is 2GB RAM, 2 cpu's, Linux OS... but I can't site an authoritative reference right now....and don't know if this is/has changed in post Java 5