Search This Blog

Showing posts with label tuning. Show all posts
Showing posts with label tuning. Show all posts

2011-10-14

Genesys GAD Server Tuning - Tomcat

Product: Genesys
Component: Genesys Desktop Server (GAD)
Version: Any version which uses Tomcat

This is generic Tomcat tuning which applicable to any GAD server version. There is nothing specific to Genesys GAD only. Genesys does not use any thing specific like below:
1. No image caching build into the jar program
2. No HTML caching build into the jar program
3. No gzip/deflat compression build into the jar program

In short, the tuning approach indicating here are:
1. Enable image and HTML caching
2. Enable gzip/delat compression in http data stream

Personally I like to use Fiddler to capture the http stream. You can use any utility which can do that to verify the before and after tune result

2 factors outside of Tomcat tuning:
1. network delay or latency
2. remote client latency

Tuning Java JVM memory
File: GAD/bin/GDesktopStarter.ini

Firstly, be aware that most Java version are 32-bit, which limits to about 2 GB of RAM or virtual RAM. This is the sum of all internal thread as well. Using 64-bit Java will remove this limitation (limit will be TB)

Tips #1: Tuning JVM heap memory

Under section [JavaArgs], tune
1. Start up heap memory -Xms, default is 64 MB I believe
2. Maximum heap memory -Xmx, default is 256 MB I believe
3. If GAD server has sufficient CPU, but would like to save RAM/virtual memory, set -Xms to smaller size so that JVM garbage collection will shrink the memory usage dynamically.
4. If would like to minimize JVM garbage collection, set both -Xms and -Xmx to same value
5. In 32-bit Java, -Xmx2G is the max value
6. There is no way to lock Java to physical memory in Windows, so setting -Xms to large value may not provide optimum performance. Refers to Windows documentation for Java with 2 GB heap memory (further reading)


-Xms128M
-Xmx512M

Tips #2: Enable content expiration
If using IIS (even Apache, or WebSphere), launch IIS Manager
1. Right click on "gdesktop" web application to get into properties
2. Click on HTTP Headers
3. Enable checkbox "Enable content expiration"
4. Specify expire after several days. Genesys's document indicated 30 days, but it depends on how frequent GAD patch install. Certainly user can delete browser cache from their PC and force reload of the new content. So if you would like to play safe, 1 day is good

Tips 3: Use IIS, Apache, or any supported web server to serve static page

IIS will be used here. After configured IIS with Tomcat, configure following

File: GAD\conf\jk\uriworkermap.properties

Old:

/gdesktop=$(default.worker)

/gdesktop/*=$(default.worker)


New:
/gdesktop/=$(default.worker)
/gdesktop/*.jsp=$(default.worker)
/gdesktop/*.do=$(default.worker)
/gdesktop/*.dow/*=$(default.worker)

Tips #4: Enable http gzip compression

This will compress HTTP content and will increase overall throughput with reduce network utilization

1. Launch IIS Manager
2. Right click on "Web Sites" folder
4. Click on tab Service
5. Enable "Compress application files"
6. Enable "Compress static files"
7. If there is a disk constraint, set temporary directory size to limit the space usage (for the compressed file)



Tips #5: Monitor GAD server

During peak load, or setup a load test, monitor GAD server's CPU, memory, disk, and network utilization.

If network is bottleneck, either upgrade NIC to faster speed, or enable HTTP compression (see above).

If CPU is bottleneck, either upgrade CPU to faster speed, add more CPU socket, or disable HTTP compression (see above)

If disk is bottleneck, it is most likely not GAD server related. The only reason I can think of is Java JVM memory tuning is too large. Reduce -Xms value to 16 MB or smaller, as well as enable worker process recycle, and shutdown worker processes after idle (for IIS). Apache has idle time out (KeepAliveTimeOut) as well, and MinSpareServers that can tune down to release virtual memory usage

Tips #6: Tomcat server.xml

File: GAD/conf/server.xml

Add following section, line 1 is comment, which can change to anything. This will has max threads of 1,000. Increase it depending on max agents and multiply by 10 (assume GAD has 9 images + 1 jsp). Use Fiddler to confirm how many objects in GAD




maxThreads="1000"
minSpareThreads="1"
maxSpareThreads="150"
enableLookups="false"
redirectPort="8443"
debug="0"
protocol="AJP/1.3"/>


Tips #7: Merge 2 or more network card

In any operating system, e.g. Linux, Windows, HP-UX, they offer NIC merging into 1 logical network card. This will double or 8x the total bandwidth. Please be aware that the network switch and router must support it. Most Cisco and Intel devices support this

This is a cheap and fast way to eliminate network bottleneck. External load balancer is another option with multiple GAD servers installation

2008-08-29

Check blocker using undocumented SQL*Plus commands

It is common that DBA called into a scene where DB is responding very slow, even for SQL*Plus. Following technique can be used to debug it using low level approach and rely on trace files generated
  • Run: sqlplus -prelimi
  • SQL> oradebug setmypid
  • SQL> oradebug hanganlyze 12, which will create new trace file in user_dump_dest.  The file name will contain UNIX process ID with the naming convention of SID_ora_PID.trc
  • Look for line that says
Found 122 objects waiting for
<0/226/17/0x1102dea82/982/no>
Open chains found:
Chain 1 : :
<0/226/17/0x1102dea82/982/no>
<0/543/43/0x1102da108/991/no>
  • Line 2 value 226 and 17 is Oracle session SID and Serial#, last 2 value 982 is UNIX PID
  • My session is waiting latch contention due to SID 226
  • UNIX PID 982 and 991 are 2 processes that causing contention
  • Use oradebug to set PID to 982 and 991, if file SID_ora_982.trc, and SID_ora_991.trc not created by Oracle database
  • Open both files and look for SQL statename with "name=UPDATE ..." where after name= will be the SQL statement
  • Search for section "PROCESS STATE"
  • Under this section, it will show "waiter count=203" which tells you how nay sessions are waiting for this process to release the latch
  • Pass the SQL statement to application owner to identify which process trigger it, and re-schedule it

2008-08-18

Oracle hot spot identification and tuning

http://www.pythian.com/blogs/1135/tuning-latch-contention-cache-buffers-chain-latches