Wednesday, December 10, 2008

Benchmarking Oracle 10g XE

Free to develop, deploy, and distribute...

Yes, that's the tagline for Oracle Database 10g Express Edition (XE), an entry-level database based on the 10g R2 code base. Certain handicaps are imposed: only one database can be installed per machine, user data is limited to 4GB, only one CPU shall be used, and only up to 1GB of memory.

Although there are several database benchmarking tools available, I've decided to try Benchmark Factory. The licensed version allows you to simulate 100 users whereas the freeware version is limited to only 20 virtual users.

My target database is an Oracle XE installed on a 32-bit Windows XP Pro system. I ran Benchmark Factory on another unit connected via a 100Mbps Ethernet LAN. Here are the workload benchmark results for 5, 10, 15, and 20 virtual users.


I encountered ORA-12519 errors (TNS:no appropriate service handler found) before the number of virtual clients reached 20. This was resolved by increasing the number of processes specified in the server parameter file (spfile). This is done via the following SQL commands:

SQL> alter system set processes=300 scope=spfile;
SQL> alter system set sessions=300 scope=spfile;

Restart the database and verify that the new parameter values have taken effect. Execute the following SQL command to display the current values:

SQL> select name, value from v$parameter where name in ('processes','sessions');

XE's response times did not falter even up to 100 users. Here is the transaction-time vs user-load comparison graph for 20 to 100 virtual users.


The 1GB memory restriction may have been breached at around 350 virtual users when I encountered ORA-12518 errors (TNS:listener could not hand off client connection). At 325 virtual users, the maximum qualified throughput (MQTH) is computed at 469.221 tpmC. The highest published TPC-C result can be found at TPC.org.

Monday, November 17, 2008

ERP on a Flash.. in a Flash

My sister is wishing for a software to help her manage the raw materials inventory of her new bakery franchise. I think I'm going to end up as her Santa this year...

Lots of ERP heavyweights abound the opensource community.. but I want something lighter. Something that can fit in a USB flash drive and delivered in a pouch -- an ERP on a Flash!

And here's my magic combo: TinyERP 4.2.2 + Ubuntu Intrepid Ibex + 2GB Imation NanoDrive.

TinyERP is included in the Ubuntu repositories -- a promise of painless installation via a series of apt-gets. PendriveLinux.com has lots of guides on how to install Linux on a USB flash drive. I favored the Ubuntu 8.10 install using the built-in USB installer. This method provides a persistence feature allowing you to save the changes on subsequent boots.

Once Ubuntu is installed and booted up, we need to issue a sudo apt-get update command in order to synchronize the package index files from their sources. But before doing that, let's edit the list of apt sources via the command sudo vi /etc/apt/sources.list. Uncomment the deb entry for the intrepid universe repository --- the TinyERP packages are contained here. Save the changes and issue the following commands to download the desired packages:

sudo apt-get update
sudo apt-get install tinyerp-server
sudo apt-get install tinyerp-client


At this point, the Postgres database server and client should be installed and two new accounts (postgres and terp) created. We still need to create the terp database and user...

sudo /etc/init.d/postgresql* restart
sudo su - postgres -c "createdb -q --encoding=UNICODE terp"
sudo su - postgres -c "createuser -q --createdb --adduser terp"

..and restart the TinyERP server.

sudo /etc/init.d/tinyerp-server restart


Press Alt-F2 and select Tiny ERP Client from the list of known applications. You can view the User Manual here .

TinyERP is re-branding itself and is now known as OpenERP.

Monday, October 20, 2008

KnowledgeTree integration using Apache Camel

What the hump is Apache Camel?

Camel is a Spring-based Integration Framework that implements routing and mediation rules using a Java-based Domain Specific Language (DSL or Fluent API), via a Spring-based XML configuration files or via Scala DSL.

The upcoming version 1.5 release includes a tutorial using Axis 1.4 with Camel. I used this example as a springboard to craft a document publisher to KnowledgeTree document management system via it's Axis-based web services.

The basic document publisher picks up an XML file, uploads it to KnowledgeTree using Apache HttpClient, and invokes KnowledgeTree's add_document webservice to include the file into the document repository. Here is the associated routing rule:

from("file:src/data?delete=true").process(ktDocUploader).to("file://target/test?noop=true");

Once the document-uploader function is implemented, the power and versatility of Camel as a routing and mediation framework comes into play. Camel supports a wide array of components allowing for more points of integration. In the above example, the File endpoint can easily be changed to FTP, SMTP, or JMS messaging without affecting the Processor code.

Route interceptors can be used to insert simple tasks like logging or complex ones like payload inspection for conditional application of logic.

intercept(xpath("/person[@user='rexjun']")).to("log:VIP").proceed();

A delivery failure is handled automatically by the Dead Letter Channel processor. I wanted failed deliveries to be deposited to another folder and this rule was implemented by a single line of code:

errorHandler(deadLetterChannel("file://target/errors"));

Aside from the Dead Letter Channel processor, Camel supports most of the Enterprise Integration Patterns and lends itself as a component of the Apache ServiceMix ESB project.

Tuesday, August 5, 2008

ZK / Tomcat Hosting at EATJ

Last night, I attempted to upload my ZK app at GoDaddys's shared hosting servers. I've planned to do this for a long time already but I just kept on postponing a possibly dreadful experience. I don't like the idea of waiting 24 hours between restarts of its Tomcat service.

So, how long is 24 hours? It's long enough to compel me to look for another webhosting service. In an hour or so, I was already up and running at EATJ web hosting solutions.

EATJ offers a free account for first-time users. For free accounts, the Tomcat JVM is shut down 4 times daily in order to save on server resources. Your Tomcat server, however, can be restarted easily within 30 secs via your control panel. The paid plans enjoy 24x7 monitoring for continuous server uptime.

I registered for a free account and got my control panel in just a couple of minutes. This guide will help you get started and ready to deploy your own app. I created my own zk307.war file containing the ZK 3.0.7 jars as well as my ZK app and dependencies by executing the command jar cvf ..\zk307.war * in the zk307 directory.

The war file is rather chunky at 21mb (the free account allows for 50mb) and uploading it seemed to be the most challenging chore of all. I had to retry once for the two uploads I did. Here's the listing of the webapps directory contents in the remote server.


Restart the Tomcat server and taadaaaa... my ZK app remotely-hosted at http://rexjun.s43.eatj.com/zk307/k3soap.zul!

If you happen to catch my Tomcat service down, don't wait for me to restart it.. instead, create your own in under an hour!

Sunday, August 3, 2008

ZK Version 3.0.7 released

The ZK front-end app to KnowledgeTree was developed using version 3.0.6. The newer version 3.0.7 was released on August 1 and I had the chance to install ZK from scratch and run the ZK front-end app successfully.

Here are the steps:

  • download zk-bin-3.0.7.zip from sourceforge.net
  • copy the MyApp directory (from the demo package) under the webapps directory of Apache Tomcat. Rename it to accordingly (I used zk307 in this example).
  • Create the WEB-INF/lib sub-directory. Place here all the jars found under the dist/lib directory of the zk-bin-3.0.7 package. Copy the jars under the ext and zkforge directories also but omit the directories - place all jars under WEB-INF/lib
  • Add the ktws.jar and the jars required by Apache Axis (see previous blog entry)

Fire up Tomcat and point your browser to http://localhost:8080/zk307/ktlogin.zul

There are over 9 new features and 22 bug fixes under this new release. Read more about the new ZK release here.