I have recently installed Nginx as a front facing server to communicate
with memcache. My problem is that the PHP code that writes into memcache
serializes the contents. I cannot turn off serialization but need to
figure out how to get the string content from memcache. The current
output from Nginx is of type application/octet-stream. Is there
something I missed?
On Fri, Oct 22, 2010 at 09:39:03AM -0400, midas wrote:
Hi,
I have recently installed Nginx as a front facing server to communicate
with memcache. My problem is that the PHP code that writes into memcache
serializes the contents. I cannot turn off serialization but need to
figure out how to get the string content from memcache. The current
output from Nginx is of type application/octet-stream. Is there
something I missed?
As memcached values doesn’t store/return any content type - nginx only
able to detect it based on request uri extension (i.e. the same
logic as for static files applies).
My problem is that the value coming from memcache is a php serialized
string content (byte-stream). I was able to change the content send from
nginx with your suggestion. But I still get errors since the response
contains invalid characters.
BTW is there a way to cache response from memcache in Nginx so that the
server does not have to keep going to memcache for data?
On Fri, Oct 22, 2010 at 03:24:56PM -0400, midas wrote:
My problem is that the value coming from memcache is a php serialized
string content (byte-stream). I was able to change the content send from
nginx with your suggestion. But I still get errors since the response
contains invalid characters.
You should put non-serialized data into memcached.
BTW is there a way to cache response from memcache in Nginx so that the
server does not have to keep going to memcache for data?
No. It’s presumed that memcached is fast enough to not require
additional caching.
This helped a lot. I was able to dig into the code and remove
serialization.
Was thinking about file caching in Nginx. Is there a way to configure
file caching? I apologize for all the questions. Kinda new to Nginx.
I need the server to respond to a very high amount of traffic.
I finally have Nginx working with memcache and doing its job perfectly.
I have a question regarding the memcache_pass configuration. Is it
possible to have a pool of memcache servers instead of one memcache
server?
On Tue, Oct 26, 2010 at 11:38:41AM -0400, midas wrote:
Hi,
I finally have Nginx working with memcache and doing its job perfectly.
I have a question regarding the memcache_pass configuration. Is it
possible to have a pool of memcache servers instead of one memcache
server?
You are free to use defined upstream[1] in memcached_pass. By
default nginx will use round-robin though. Blancing methods
compatible with Cache::Memcached and other memcached client
libraries are available as third party modules[2][3].