简体   繁体   中英

Is there a limit in Rails for maximum number of sessions?

I am using Rails 4.2.7.1, and MySQL to store the sessions.

One of my colleagues told me that there is a limitation on the maximum number of sessions that can be supported by Rails, but I couldn't find a reference to this subject.

Is there a maximum number of sessions supported by Rails?

If you are using MySQL as a session store, all your session data exists in serialized form in the database:

mysql> desc sessions;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      |      | PRI | NULL    | auto_increment |
| session_id | varchar(255) | YES  | MUL | NULL    |                |
| data       | text         | YES  |     | NULL    |                |
| updated_at | datetime     | YES  |     | NULL    |                |
+------------+--------------+------+-----+---------+----------------+
4 rows in set (0.02 sec)

The maximum number of sessions, not the individual session size, is actually limited by the number of rows per table in the MySQL database -- which is quite huge -- or by your disk space but not by Rails itself.

See " Maximum number of records in a MySQL database table " for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM