无法写入会话数据(内存缓存) [英] Failed to write session data (memcache)

查看:169
本文介绍了无法写入会话数据(内存缓存)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我们的Memcached会话处理程序存在 间歇性 问题.发生的错误是:

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

未知:无法写入会话数据(内存缓存).请确认 当前session.save_path的设置正确.

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

注意:

  • 这似乎是一个间歇性问题,每天对各种用户出现5到6次.
  • Memcached不是本地主机.也就是说,它位于与网络服务器不同的服务器上.
  • 我正在使用Memcache扩展(而不是MemcacheD扩展).
  • 我正在使用tcp前缀.如果您查看此问题,您会看到如果您使用的是Memcache扩展名,则修复"是在tcp://前面加上一个前缀.
  • 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.

我的php.ini设置:

My php.ini settings:

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

请注意,我也使用过:

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

但这似乎无关紧要.

检查了memcached.log文件,发现以下错误:

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

写入失败,不是由于阻塞:连接被对等方重置.

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

注意:该特殊错误每天至少在同一时间(01:07 AM)发生一次.然后,它会整天零星地发生.

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

推荐答案

也许您是

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.

这篇关于无法写入会话数据(内存缓存)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆