hi

I've been looking into variations of performance with different versions of Tomcat to serve a website of approximately 6000 URLs using Cocoon 2.1.4. Performance was noticeably slower using Tomcat 4, the reason being garbage collection.

To turn garbage collection on using the Sun JVM, append

-Xloggc:/opt/tomcat/logs/garbage.log

to the CATALINA_OPTS variable, where /opt/tomcat is the location of your Tomcat instance.

Crawling the site using the free Xenu crawler tool, performance under Tomcat 4.1.27 degraded significantly after around 1000 URLs. Examining the logs, the reason was soon obvious.

1334.524: [Full GC 518449K->518079K(518464K), 2.5774490 secs]
1337.102: [Full GC 518079K->518079K(518464K), 2.5330770 secs]
1339.654: [Full GC 518458K->518188K(518464K), 2.5701920 secs]
1342.224: [Full GC 518188K->518179K(518464K), 2.5360680 secs]
1344.802: [Full GC 518456K->518233K(518464K), 2.5695450 secs]
1347.371: [Full GC 518233K->518214K(518464K), 3.2225810 secs]
1350.610: [Full GC 518403K->518180K(518464K), 2.5540920 secs]
1353.164: [Full GC 518180K->518178K(518464K), 2.5558220 secs]


It was spending all its time garbage collecting!




Using Tomcat 5.0.19, after approx 30000 hits on the site, the log is certainly more pleasing:
13435.211: [GC 749150K->686258K(765332K), 0.1123580 secs]
13442.140: [GC 755121K->692181K(765332K), 0.1140720 secs]
13449.131: [GC 761045K->700089K(769044K), 0.1324210 secs]
13449.265: [Full GC 700089K->233002K(769044K), 1.8186920 secs]
13460.298: [GC 301859K->245577K(765332K), 0.1021830 secs]
13468.507: [GC 314440K->254022K(765332K), 0.1221460 secs]
13476.208: [GC 322886K->259107K(765332K), 0.1037680 secs]
13482.677: [GC 327971K->267097K(765332K), 0.1375070 secs]
13492.732: [GC 335961K->274713K(765332K), 0.1315550 secs]
13500.313: [GC 343577K->279775K(765332K), 0.1020140 secs]
13508.526: [GC 348634K->286971K(765332K), 0.1172210 secs]
13517.606: [GC 355831K->292747K(765332K), 0.1061540 secs]



As you can see the Full GC (Full Garbage Collect) is happening sporadically, thus server performance is improved.



It should be noted that exactly the same WAR file and tomcatd / CATALINA_OPTS were used for both versions of Tomcat.



The parameters I have changed from the default installation:


garbage collection logging as above
set max heap size to 1000M
made NO CHANGES to the store janitor parameters
set all pool-max values for the objects I am using to 1024

Use Tomcat 5.0.19, JDK 1.4.2
CIncludes cached for 12 hours
Apache serving static files


As a little side note after the crawl had finished, I saw 700M of heap space being reclaimed by a garbage collect :) This would indicate that the memory issues that were inherent with 2.1.2 have disappeared.



I hope the above is of interest to those having performance problems



Cheers


Gordon

Gordon Anderson
3months.com




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to