v8.6 - MySQL Memory Storage Engine

Probably a question for Chaveiro, but anyone chip in!

What is the vision regarding the MySQL Memory Storage Engine, and how do you see it being used in emoncms v8.6?

From what I know, access to the data is quicker with low latency, but it's volatile and the data is lost after the MySQL server stops or is restarted.

Also it progressively eats into system memory which is not reclaimed even if rows are deleted, (only when the table is deleted).

Paul

chaveiro's picture

Re: v8.6 - MySQL Memory Storage Engine

Hi Paul, i remember reading on the forum about saving just the last value instead of historic feed data. Memory fits that purpose and gives past data since reboot. It's really up to the user to choose if it fits his need.

Data is kept in ram, so its 'low-write'.

The mysql default limit is 16MB per table, thats about 500.000 data points.

From mysql docs https://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html :

MEMORY table contents are stored in memory, which is a property that MEMORY tables share with internal temporary tables that the server creates on the fly while processing queries. However, the two types of tables differ in that MEMORY tables are not subject to storage conversion, whereas internal temporary tables are:

MEMORY tables are never converted to disk tables. If an internal temporary table becomes too large, the server automatically converts it to on-disk storage, as described in Section 8.4.4, “How MySQL Uses Internal Temporary Tables”.

The maximum size of MEMORY tables is limited by the max_heap_table_size system variable, which has a default value of 16MB. To have larger (or smaller) MEMORY tables, you must change the value of this variable. The value in effect for CREATE TABLE is the value used for the life of the table. (If you use ALTER TABLE or TRUNCATE TABLE, the value in effect at that time becomes the new maximum size for the table. A server restart also sets the maximum size of existing MEMORY tables to the global max_heap_table_size value.) You can set the size for individual tables as described later in this section.

Paul Reed's picture

Re: v8.6 - MySQL Memory Storage Engine

Yes, I had read the MySQL docs earlier, but can you give a practical example where this could be used effectively in the emoncms environment?

Paul

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.