What is the PHP shared memory session module (mm, --with-mm)?

What is the PHP shared memory allocation ( mm , compiled - s-mm ) session module?

Did you use it? Have you tested it? Does this work well? Did you have problems blocking your session?

It is easy to view the contents of your session data when using files or a custom session handler (such as a database), but is it possible to view session data using this module? Personal reasons for viewing session data are to (1) verify that the PHP garbage collection is working correctly and (2) make sure that it does not clog all system memory.

I think it was a separate extension (PECL? Zend?), But now it is mostly.

The only requirement to compile it into a PHP binary is the OSSP mm headers , which are a small load of ~ 330 thousand.

$ ./configure --help // --with-mm=DIR SESSION: Include mm support for session storage 

The only information I could find was a message from a 2006 message linking to the Zend session [404] page, from which the author quoted:

If you need better performance, the mm module is a viable alternative; It stores data in shared memory and therefore is not limited to a hardware I / O system.

I understand two of these limitations :

(1) Note that the session storage module for mm does not guarantee that simultaneous access to the same session is properly blocked. It might be more appropriate to use a file system based on shared memory (e.g. tmpfs on Solaris / Linux or / dev / md on BSD) to store sessions in files because they are correctly locked. (2) Session data is stored in memory so restarting the web server deletes it.

I would really like the canonical description, but any information is appreciated.

+10
source share

Source: https://habr.com/ru/post/952115/


All Articles