Skip to main content
Tweeted twitter.com/StackDBAs/status/1186296191547576322
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited title
Source Link
RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531

MySQL lock on memoryMEMORY storage engine, when does it apply?

I want to use MySQL MEMORY storage engine to handle my PHP session variables (actually I already implemented it but since all my tests are being done by a single user, me, I am unable to notice this).

As it says here: http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

"MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes."

MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes.

I don't understand this statement. It makes me think that when you insert/update/replace the table locks itself automatically and entirely so you will not be able to select anything while the write is being done. Is this correct? Can this be disabled? I need to write and read quite frequently and at the same time and I am not planning on doing transactions on this table:

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `data` varchar(64000) NULL,
  `expires` int(11) UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`)
)ENGINE=MEMORY;

MySQL lock on memory storage engine, when does apply?

I want to use MySQL MEMORY storage engine to handle my PHP session variables (actually I already implemented it but since all my tests are being done by a single user, me, I am unable to notice this).

As it says here: http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

"MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes."

I don't understand this statement. It makes me think that when you insert/update/replace the table locks itself automatically and entirely so you will not be able to select anything while the write is being done. Is this correct? Can this be disabled? I need to write and read quite frequently and at the same time and I am not planning on doing transactions on this table:

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `data` varchar(64000) NULL,
  `expires` int(11) UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`)
)ENGINE=MEMORY;

MySQL lock on MEMORY storage engine, when does it apply?

I want to use MySQL MEMORY storage engine to handle my PHP session variables (actually I already implemented it but since all my tests are being done by a single user, me, I am unable to notice this).

As it says here: http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes.

I don't understand this statement. It makes me think that when you insert/update/replace the table locks itself automatically and entirely so you will not be able to select anything while the write is being done. Is this correct? Can this be disabled? I need to write and read quite frequently and at the same time and I am not planning on doing transactions on this table:

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `data` varchar(64000) NULL,
  `expires` int(11) UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`)
)ENGINE=MEMORY;
added 24 characters in body; edited tags
Source Link
RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531

I want to use MySQL MEMORY storage engine to handle my phpPHP session variables (actually I already implemented it but since all my tests are being done by a single user, me, I am unable to notice this).

As it says here: http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

"MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes."

I don't understand this statement. It makes me think that when you insert/update/replace the table locks itself automatically and entirely so you will not be able to select anything while the write is being done. Is this correct? Can this be disabled? I need to write and read quite frequently and at the same time and I am not planning on doing transactions on this table:

CREATE TABLE sessions ( id varchar(255) NOT NULL, data varchar(64000) NULL, expires int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (id) )ENGINE=MEMORY;

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `data` varchar(64000) NULL,
  `expires` int(11) UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`)
)ENGINE=MEMORY;

I want to use MySQL MEMORY storage engine to handle my php session variables (actually I already implemented it but since all my tests are being done by a single user, me, I am unable to notice this).

As it says here: http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

"MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes."

I don't understand this statement. It makes me think that when you insert/update/replace the table locks itself automatically and entirely so you will not be able to select anything while the write is being done. Is this correct? Can this be disabled? I need to write and read quite frequently and at the same time and I am not planning on doing transactions on this table:

CREATE TABLE sessions ( id varchar(255) NOT NULL, data varchar(64000) NULL, expires int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (id) )ENGINE=MEMORY;

I want to use MySQL MEMORY storage engine to handle my PHP session variables (actually I already implemented it but since all my tests are being done by a single user, me, I am unable to notice this).

As it says here: http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

"MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes."

I don't understand this statement. It makes me think that when you insert/update/replace the table locks itself automatically and entirely so you will not be able to select anything while the write is being done. Is this correct? Can this be disabled? I need to write and read quite frequently and at the same time and I am not planning on doing transactions on this table:

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `data` varchar(64000) NULL,
  `expires` int(11) UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`)
)ENGINE=MEMORY;
Source Link

MySQL lock on memory storage engine, when does apply?

I want to use MySQL MEMORY storage engine to handle my php session variables (actually I already implemented it but since all my tests are being done by a single user, me, I am unable to notice this).

As it says here: http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

"MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly for statement mixes that include writes."

I don't understand this statement. It makes me think that when you insert/update/replace the table locks itself automatically and entirely so you will not be able to select anything while the write is being done. Is this correct? Can this be disabled? I need to write and read quite frequently and at the same time and I am not planning on doing transactions on this table:

CREATE TABLE sessions ( id varchar(255) NOT NULL, data varchar(64000) NULL, expires int(11) UNSIGNED DEFAULT NULL, PRIMARY KEY (id) )ENGINE=MEMORY;