[Ace-users] Re: question about SSL communication and TCP
AmnonAB at gmail.com
Thu Jul 19 04:28:28 CDT 2007
On Jul 17, 10:10 pm, richard zhao <rich4t... at yahoo.com> wrote:
> Hello, All,
> I am doing Client/Server network progarmming by using ACE. Between Client and Server, I tried two kinds of connections, one connection is TCP connection and another one is SSL connection. through testing, I found TCP connection is much faster than SSL connection. For example, when I send some data by TCP connection, it will take 17s. however when I send same data by SSL connection. it will take 79s. I know SSL connection should be slower than TCP connection. do you think it should be so slow? what I did is as following:
> if (SSLConnection) //ssl connection
> send_cnt = this->peer ().sendv_n (iov, 2);
> else //TCP connnection
> send_cnt = this->peer ().peer().sendv_n(iov, 2);
> all code is same except for the above parts.
> thank you very much for your comments and suggestion in advance.
> Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
Most of the SSL overhead is generated because of the SSL Handshake,
using the more cpu-expensive Public-Private Key encryption. Once the
Handshake is complete the connection uses symetric encryption (until
it closes or until a re-handshaking takes place). It's reasonable that
SSL Handshake would take this long. If you want to get a better
comparison, use bigger data pools over a longer period of time, you
will see how the handshake is the most expensive part of the process.
More information about the Ace-users