[Zope-DB] Zope-DCOracle2 vs Tomcat-JDBC performance
Umberto Nicoletti
unicoletti@prometeo.it
Fri, 23 May 2003 15:53:16 +0200
Hi all,
we're proud users of Zope, but recently we ran into some performance
issues.
We have some Zope applications that are database (Oracle) intensive and
recently experienced some *huge* slowdowns when under heavy usage. We
had no problems before because the usage was modest (under 5 concurrent
users).
Since this is SHOW STOPPER for us we decided to spend some time and
investigate further. We took a server and installed Zope 2.6.1, python
2.1.3 and DCOracle2 1.3b on Suse
Linux 8.0. On the same server we installed jakarta tomcat 4.1.24 with
Sun JDK 1.4.1_02 and Oracle JDBC.
On another server (identical HW and SW) we have an Oracle 8.1.7 instance
and so we ran some simple queries against it from Zope and Tomcat.
Result is that with small pages in both size and number of records
(under 5) displayed Zope is head to head with Tomcat.
With larger pages (about 50 records displayed with no whatsoever html
tables or other embellishment) Tomcat is MUCH faster (see below).
We believe the problem is somehow related to threading issues in
Zope/Python.
Can anyone help us figure out what's wrong with our Zope setup?
Best regards,
Umberto
Env Details:
HW (for both Zope/Tomcat and Oracle): PIII 1GHZ, 256 MB RAM, 2 Ultra160
SCSI drives (HP NetServer E800), 100Mb Switched Ethernet
Zope:
2.6.1
Startup parameters:
/usr/bin/python /opt/zope261/z2.py -X -f 7022 -t 7 -i 250 -w 7080 -u
zope -z /opt/zope261 -Z /var/run/zope.pid -L en_US -l /var/log/zope.log
We tried this optimization (second zope run):
#cat /opt/zope261/custom_zodb.py
import ZODB.FileStorage
import ZODB.DB
import os.path
filename = os.path.join(INSTANCE_HOME, 'var', 'Data.fs')
Storage = ZODB.FileStorage.FileStorage(filename)
DB = ZODB.DB(Storage, pool_size=7, cache_size=8000)
#EOF
Tomcat:
4.1.24 binary from jakarta.apache.org
Sun JDK 1.4.1_02
*NO OPTIMIZATION WHATSOEVER*
The page querying Oracle opens a connection for every user and that is
saved into the session. So there are as many connections opened at the
end of a test run as are the users.
Test client:
JMeter built from cvs 1 week ago
Test setup:
two jmeter slave and one server: 25 threads, ramp up time 10, loop
count 5 (total of 250 requests)
test items:
1 static page, jakarta_html (about 30K = jakarta.apache.org home page)
1 dynamic page, lista50 from Oracle DB (about 22K = first 50 of 1700
records from select)
TEST results:
all times in ms
rt=response time: from first byte sent of the request to last byte
received
Round 1 (static page and dynamic with 50 records showed from db):
page req. avg min max errors rate
number rt rt rt
----------------------ZOPE----------------------
jakarta_html 250 52710 50 112752 0,00% 22,9/min
/test/lista50 250 73238 10405 140512 0,00% 21,5/min
------------ZOPE with custom_zodb.py------------
jakarta_html 250 52740 20 109748 0,00% 22,8/min
/test/lista50 250 73026 11246 133833 0,00% 21,6/min
---------------------TOMCAT---------------------
/jakarta.html 250 560 0 2604 0,00% 10,4/sec
/index.jsp 250 455 40 2944 0,00% 10,4/sec
Comparison results (CSV format for your graphing pleasure):
Response times per URL (ms),(max1),(max2),(max1-max2),(%)
index.jsp,133833,2944,130889,97.80
jakarta.html,109748,2604,107144,97.63
max1=zope
max2=tomcat
Response times per URL
(ms),(samples),(max1),(avg1),(min1),(max2),(avg2),(min2)
index.jsp,250,133833,73026,11246,2944,455,40
jakarta.html,250,109748,52740,20,2604,560,0
max1,min1,avg1=zope
max2,min2,avg2=tomcat
As you see the difference is enourmous.