Failed to write session data (memcache)

▼魔方 西西 提交于 2019-12-06 00:46:56

问题


I'm noticing an intermittent issue with our Memcached session handler. The error that occurs is:

Unknown: Failed to write session data (memcache). Please verify that the current setting of session.save_path is correct.

Notes:

  • It seems to be an intermittent issue that occurs 5 or 6 times a day to various users.
  • Memcached is not localhost. i.e. It's on a different server than the web server.
  • I'm using the Memcache extension (as opposed to the MemcacheD extension).
  • I'm using the tcp prefix. If you look at this question, you'll see that the "fix" was to put tcp:// a prefix if you're using the Memcache extension.

My php.ini settings:

session.save_handler = memcache
session.save_path = "tcp://64.233.191.255:11211"

Note that I've also used:

session.save_path = "tcp://64.233.191.255:11211?persistent=1&weight=1&timeout=1&retry_interval=15"

But it doesn't seem to matter.

Checked the memcached.log file, where I found the following error:

Failed to write, and not due to blocking: Connection reset by peer.

Note: This particular error occurs at least once, at the same time (01:07AM), everyday. It will then occur sporadically throughout the day.


回答1:


Maybe you're running out of filehandles? Perhaps the backups make your machine swap, resulting in slower responses, meaning more concurrent connections to the memcached process resulting in a stampeding hurd.



来源:https://stackoverflow.com/questions/23008696/failed-to-write-session-data-memcache

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!