Home  >  Article  >  Backend Development  >  PHP中使用memcached在数据同步更新上面会不会存在问题呢?

PHP中使用memcached在数据同步更新上面会不会存在问题呢?

WBOY
WBOYOriginal
2016-06-06 20:37:27793browse

PHP中使用memcached在数据同步更新上面会不会存在问题呢?

回复内容:

PHP中使用memcached在数据同步更新上面会不会存在问题呢?

我觉得使用Memcache要注意两个比较频繁发生的问题:

  1. 并发更新一个key。(解决:加锁)
  2. 内存分区满了以后,如果该内存块再存储新key的时候会踢掉旧的。(解决:Memcache监控)

PHP中使用memcache 一般会用来做mysql的一层数据缓存,来减少对mysql的直接连接,从而提升性能。
而memcache 数据保存失败,一般是因为服务器端这个数据key已经存在了
一般只要你的数据key与value符合memcache的条件,且内存足够使用,很少会出现数据更新失败的情况!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn