JdbcStore

From Resin 3.0

Jump to: navigation, search

JdbcStore uses a database for persistent sessions.

Is the JdbcStore slower than the ClusterStore?

No, the performance of the JdbcStore is very good.

  • databases are very good at mediating between different clients
  • Resin does a number of things to minimize communication with the database. For example, before reading or writing the session Resin does a base64 checksum calculation. If the checksum in the database matches, Resin can avoid writing or reading the contents of the serialized session to the database.

Tips

Fast JdbcStore with MySQL

For a database table with a low read/write ratio that doesn't need to survive a database crash, you can get better performance with InnoDB than MyISAM by set innodb_flush_log_at_trx_commit=0. By default it is 1, which means every commit writes the journal entry to disk. Setting it to 0 means it will only write to disk every second or when the journal log file is full.

This gets you the benefit of row-level locking (instead of MyISAM which needs a table lock to insert or update a record) without slowing yourself down for file system writes.

http://dev.mysql.com/doc/mysql/en/internal-locking.html http://www.mysql.com/news-and-events/newsletter/2003-12/a0000000285.html

(thanks to Serge for this great tip)

Personal tools