0

I have a Redhat Enterprise LAMP server, hosting a Magento site, where I recently set up tmpfs for the session directory to improve performance. The tmpfs partition is mounted with the following command:

mount -t tmpfs -o rw,noexec,nosuid,size=6144M,mode=1777,uid=48,gid=48 tmpfs /path/session

After mounting the session directory to tmpfs, the following warning is thrown in about 1% of all sessions:

 Warning: session_start(): open(/path/session/sess_random_session_id, O_RDWR) failed: Protocol driver not attached (49)  in /path/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 115**

I haven't been able to reproduce the error - but it occurs several times daily, according to logs.

I am running Apache v 2.2.3 and Magento v 1.4.0.1

bummi
  • 27,123
  • 14
  • 62
  • 101
Dr. Noerb
  • 1
  • 1

1 Answers1

0

You should use Memcache to store session, files are bad because PHP locks the current user session file during all the PHP execution, and I know Magento has some AJAX queries executed in parallel :/

Also, I believe TMPFS regenerate inode (how are inode numbers generated in linux tmpfs?) so it mays cause a problem with sessions.

Community
  • 1
  • 1
Thomas Decaux
  • 21,738
  • 2
  • 113
  • 124
  • How does the file lock + ajax query differ when using memcached rather than tmpfs? The problem occurred while switching to tmpfs. – Dr. Noerb Oct 25 '13 at 08:31
  • Imagine a web site who does 4 AJAX calls after page load, that means 4 new HTTP connections from same session (means also 4 mysql connections etc...), but PHP use file lock to retrieve file session between session_start() and session end or Php exists. Memcache session has not this lock. – Thomas Decaux Oct 25 '13 at 09:47
  • I recommended you memcache because I believed you switch to tmpfs in order to improve performance of session? – Thomas Decaux Oct 25 '13 at 09:48