You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by ci...@gmail.com on 2006/07/10 19:20:38 UTC

Increasing Performance over Mina

Hi ,

I working on a  Image transfer application between a client and server over Mina.
Image files are around 3000 kbs in length. Im transfering over a compression filter followed by
a Objectserialization protocol handler. 
Transfering 1 image file to my localhost would take around 2 seconds. I was wondering if there is
any way to increase this benchmark? I know this is a silly question on bandwitdh and latency but any suggestions would be apreciated. Heres a snipet of the code.

public void messageReceived(..,..){
// Serialized object 
        CommandMsg commandMsg = (CommandMsg) obj;
        
        //get a fresh new bytebuffer from the producer (exchanger object)
        fullBB = exchanger.exchange(fullBB);

        //close session if the byte buffer is empty
        if(fullBB== null){
            session.close();
            return;
        }

        //set bytes to the object setter method
        commandMsg.setImageByte(fullBB);
        
        //encrypt the bytes over AES and encrypt the key over RSA
        commandMsg = cipherFacade.cipher(commandMsg);

        //write it out..
        session.write(commandMsg);
}

Re: Increasing Performance over Mina

Posted by peter royal <pr...@apache.org>.
On Jul 10, 2006, at 1:20 PM, <ci...@gmail.com> <ci...@gmail.com>  
wrote:
> I working on a  Image transfer application between a client and  
> server over Mina.
> Image files are around 3000 kbs in length. Im transfering over a  
> compression filter followed by
> a Objectserialization protocol handler.
> Transfering 1 image file to my localhost would take around 2  
> seconds. I was wondering if there is
> any way to increase this benchmark? I know this is a silly question  
> on bandwitdh and latency but any suggestions would be apreciated.  
> Heres a snipet of the code.

Have you benchmarked to see how much time is being taken up by the  
compression and cypher vs transmission?

You could also try tuning the buffer sizes on the sockets as well,  
but I'd start with doing some more fine-grained timings to determine  
why its taking that amount of time.

-pete

-- 
proyal@apache.org - http://fotap.org/~osi