Reduced memory usage per connection with boost :: asio ssl server

I am working on an ssl server using boost :: asio. I try to reduce memory usage by one ssl connection as much as possible.

My code is mainly derived from boost :: asio :: ssl example server example. This means that I store the sessions as an object of the Session class that has the sslContext attribute registered by read_handler, etc. (To a large extent, as in the example)

All the optimization I could find includes SSL_MODE_RELEASE_BUFFERSand SSL_OP_NO_COMPRESSION. And now I am about 55 kB per connection.

However, according to this topic , you can reduce memory usage by up to 11 KB.

Is there anything else I can do to reduce this usage?

OS: Ubuntu 11.04 and accelerated version: 1_55

+4
source share
1 answer

His important question for me, too, so I took care of this a bit.

The asio :: ssl engine implementation currently has at least 34 KB of memory. You can see it in the source code stream_core.hpp , max_tls_record_size. The valgind massif tool confirms this. But I could not find how to avoid this, since these buffers are used deeply in io_op .

+1
source

All Articles