且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

计算活动会话

更新时间:2023-11-27 23:04:40

Memcached本质上不是要那样使用(它是一个短暂的缓存存储,它不打算像聚合查询一样执行SQL/数据库操作) ,并且当前的活动会话通常不是我不感兴趣的(出于负载目的,网络服务器的点击量和统计数据要重要得多).

Memcached by nature isn't meant to be used like that (it's a fleeting cache store, it is not intended to do SQL / database like aggregate queries over), and current active sessions is usually not something I am remotely interested in (for load purposes, the hits & statistical data of the webserver is much more to the point).

但是,如果您仅使用内存缓存 来存储会话数据(而不是其他键值对),则可以使用

If you are however use memcache only to store session-data (not other key-value pairs), you can use getStats() to get an item count (cur_items) on the current memcache server.