axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Betsy Frey" <>
Subject RE: [AXIS2] MTOM performance
Date Mon, 19 Mar 2007 16:52:05 GMT
Thanks, Rodirigo, but the problem is not my disks.
I changed the code to generate bytes on the fly, instead of from a
source file.  I changed the reference from localhost to  I am
just looking at the file in the attachment directory; not moving or
copying it.   I continue to see it grow by about 3.7mb/minute.
Separately, I have confirmed that the transfer is in binary in a MIME
section; MTOM is enabled.
So the question remains:  why is MTOM performance so sluggish, and is
there anything to be done about it?

-----Original Message-----
From: Rodrigo Ruiz [] 
Sent: Monday, March 19, 2007 8:57 AM
Subject: Re: [AXIS2] MTOM performance

Several reasons :-)

First, a file system copy can make use of low-level OS mechanisms to
speed up transfers, and even in some cases, delegate the job to the disk
manager chipset. You will never get these speeds with a web service, as
it will never have direct access to the client file system.

Said this, if you think about what the client and server do, leaving
aside the overhead from XML transfer and processing, you will notice
that having the client and server on the same machine is not a good

On one side, the client must read the file from disk. If the client is
correctly configured and programmed, the client will send the file
contents to the server at the same time it is reading it (concurrently),
so to avoid putting the whole file in memory.

On the other side, the server will write the incoming bytes to a file
while it is receiving the client request. Finally, once the whole file
is received in the server side, your service will usually move the file
to its final destination. If you copy the file instead of moving it, the
service will perform even worse ;-)

Now, if you join both sides, you will see the system must read and write
the same file at different locations of the disk. This will make your
test waste a lot of time just in disk head seeks.

I would propose you to make sure that you follow these guides:

* Make sure reads and writes are, at least, from/to different (physical)
disks. If you have only one disk per machine, but you have several
machines, try to put client and server in different hosts. Take into
account that a fast ethernet bandwidth is far better than 3.7MB per
minute ;-)

* If you want to do some tests for only one of the sides, another
approach could be to create mockups for the file readers and writers.
For example, if you use a DataHandler in the client side, you can
implement a fake DataSource that generates random bytes on the fly,
instead of reading them from a file. Such a DataSource will allow you to
test your server side performance without the client interfering in your
disk accesses.

* Always use the localhost address ( to contact the server. In
many environments you will get different (and worse) results if you use
the machine public IP address.

* Make sure you do your best to "move" the file in the server side to
its final location instead of copying it. The performance is totally

Hope this helps you,
Rodrigo Ruiz

Betsy Frey wrote:
> I've just made some measurements, transferring files using MTOM in
> on tomcat.  My client and servlet are on the same machine.
> are cached.  For files of 1mb or more, the transfer rate,
> client-to-servlet, is about 3.7mb per minute.  In contrast, a file
> system copy transfers at about 2.5gb per minute:  675 times faster
> Axis2.
> Why is MTOM performance is so sluggish?
> Thanks for any assistance,
> Betsy
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient,
please contact the sender by reply e-mail and destroy all copies of the
original message.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

GRID SYSTEMS, S.A.             Rodrigo Ruiz
Parc Bit - Edificio 17         Research Coordinator
07121 Palma de Mallorca
Baleares - Spain               Tel: +34 971 435 085    Fax: +34 971 435 082

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message