framework icon indicating copy to clipboard operation
framework copied to clipboard

Use memcached cache driver

Open yuchen99 opened this issue 12 years ago • 2 comments

I use memcached server for the cache driver.But when the application run a long time(5 days ) the server will take so many TIME_WAIT connection ().Is the connection keepalive and How can I reset the connection or close the connection

 netstat -atounlp | grep 'memcached ' | more
tcp        0      0 127.0.0.1:11211             0.0.0.0:*                   LISTEN      1729/memcached      off (0.00/0/0)
tcp        0      0 192.168.1.21:11211          0.0.0.0:*                   LISTEN      1583/memcached      off (0.00/0/0)
tcp        0      0 127.0.0.1:11211             127.0.0.1:55651             ESTABLISHED 1729/memcached      keepalive (6890.79/0/0)
tcp        0      5 127.0.0.1:11211             127.0.0.1:37286             ESTABLISHED 1729/memcached      on (0.17/0/0)
tcp        0      0 127.0.0.1:11211             127.0.0.1:54926             ESTABLISHED 1729/memcached      keepalive (6011.89/0/0)
tcp        0      0 127.0.0.1:11211             127.0.0.1:47881             ESTABLISHED 1729/memcached      keepalive (6634.08/0/0)
udp        0      0 127.0.0.1:11211             0.0.0.0:*                               1729/memcached      off (0.00/0/0)
udp        0      0 192.168.1.21:11211          0.0.0.0:*                               1583/memcached      off (0.00/0/0)

use code like Cache::put("key",value,timeout) Cache::remember()

yuchen99 avatar Nov 10 '14 09:11 yuchen99

Why cache in memory information for so long time? I suggest you to use another tool to cache your information. Perhaps use the file driver.

jonathanpmartins avatar Nov 22 '14 20:11 jonathanpmartins

Continue this on the forums if need be.

GrahamCampbell avatar Nov 22 '14 20:11 GrahamCampbell