You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Aleksandar <al...@gmail.com> on 2007/02/04 02:11:41 UTC

Closing ssl sessions performance

Hi,
I have performance problems with mina and ssl filter.

When client's session idle about 30 seconds then session must be closed.
Everyting works fine when closing 300 sessions, but with 400 sessions system
usage goes to 100% and operating system crashes.

This is a snip code from my SessionHandler:
    public void sessionIdle(IoSession aSession, IdleStatus aIdleStatus)
    throws Exception {
        aSession.close();
    }

    public void sessionClosed(IoSession aSession)
    throws Exception {
        if (!SessionManager.isInformationSession(aSession)
                && !SessionUtil.isCommandSession(aSession)) {
            logger.warn("Closing undefined session!");
            sessionManager.removeSession(aSession);
            return;
        }

        if (SessionManager.isInformationSession(aSession)) {
            sessionManager.unregister(aSession);
        }
        if (SessionUtil.isCommandSession(aSession)) {
            String username = SessionUtil.getUsername(aSession);
            logger.info("Logout " + username);
        }

        Long id = SessionUtil.getSessionID(aSession);

        if (!sessionManager.removeSession(aSession)) {
            logger.error("Error removing session with id " + id);
        } else {
            logger.debug("Session with id " + id + " removed
seuccessfuly.");
        }
   }

Server has four Xeon 1.86GHz cpus.

Thanks in advance.