[英]Memcache in high performance sites with PHP
I have been working in trying to optimize a webservice that is required to return somewhat quickly (less than 1 second) and is required to maintain a high load of requests (greater than 1000/second). 我一直在努力优化需要快速返回(少于1秒)的Web服务,并且需要维持高负载的请求(大于1000 /秒)。 We are using memcached as a way to store objects "in memory". 我们使用memcached作为一种在内存中存储对象的方法。 It seems we are getting a large number of timeout errors from memcache. 看来我们从memcache中获得了大量的超时错误。
[Thu Jul 23 22:59:42 2009] [error] [client 123.456.789.10] PHP Warning: Memcache::connect() [memcache.connect]: Can't connect to 127.0.0.1:11211, Connection timed out (110) [2009年7月23日22:59:42] [错误] [客户端123.456.789.10] PHP警告:Memcache :: connect()[memcache.connect]:无法连接到127.0.0.1:11211,连接超时( 110)
So, on to the questions. 所以,关于问题。
Is a good use of memcache to store objects in memory that are time consuming to create? 是否可以很好地利用memcache将对象存储在内存中,而这些对象的创建时间很长? Would APC be a better location for these objects? APC会成为这些物体的更好位置吗? The number of reads and 读数和
Are there common pitfalls that I am overlooking in setting up memcache to work more efficiently? 在设置memcache以更有效地工作时,我是否会忽略常见的陷阱?
Thanks for any help, I am somewhat new to working with memcache, and I think there is something I am missing. 感谢您的帮助,我对使用memcache感到有些新意,我觉得我有些遗漏。
To answer your first point : 回答你的第一点:
One thing to about APC : if you use it for it's opcode cache ability (you should), make sure you configure it to have enough RAM for opcode+cache (so that it doesn't run out of memory for opcode cache, which would be bad) 关于APC的一件事:如果你使用它的操作码缓存能力(你应该),请确保你配置它有足够的RAM用于操作码+缓存(这样它就不会耗尽内存用于操作码缓存,这会坏)
If you need more (specific) help with memcached and don't get much help here, there is a mailing-list, which is sometimes quite active ; 如果您需要更多(特定)有关memcached的帮助,并且在这里没有得到太多帮助,那么有一个邮件列表,有时非常活跃; maybe trying there could be useful. 也许尝试可能有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.