SSL memory consumption

Kaiduan Xie kaiduanx@REDACTED
Thu Dec 23 22:21:46 CET 2010


Hi, all,

I found SSL consumes a lot of memory per SSL connection. The following
is the observation,

1. 10K SSL connections, for each SSL connection, a gen_fsm is started
to listen on SSL socket to receive the data.
2. Before accepting SSL connection, the server consumes 515M memory.
3. After 10K SSL connections, the server consumes 2.2G memory.
4. All SSL connections are idle, no traffic is carried on the connection.

So each SSL connection consumes about 170 K, I think this number is a
little bit high.

The information about test environment is listed below,

1. kaiduanx@REDACTED:/usr/include/openssl$ uname -a
Linux dell-xps-7100 2.6.35-23-generic #41-Ubuntu SMP Wed Nov 24
11:55:36 UTC 2010 x86_64 GNU/Linux
2. system has 4 G memory
3. Erlang R14A (erts-5.8) [source] [64-bit] [smp:6:6] [rq:6]
[async-threads:0] [kernel-poll:true]
4. ssl:version().
{ok,{"4.0","OpenSSL 0.9.8o 01 Jun 2010",
     "OpenSSL 0.9.8o 01 Jun 2010"}}


Eshell V5.8  (abort with ^G)

Any idea on why each SSL connection consumes so many memory? Please
share your comment and experience.

Thanks,

/Kaiduan


More information about the erlang-questions mailing list