开发者

What system to use for a key-value cache on a single server

开发者 https://www.devze.com 2022-12-16 04:43 出处:网络
I\'m implementing a PHP script which will need some caching capabilities. I\'m trying to determine which caching strategy to use for user data assuming that the script is running on a single server.

I'm implementing a PHP script which will need some caching capabilities.

I'm trying to determine which caching strategy to use for user data assuming that the script is running on a single server. I'm probably looking at about 50k different keys. The data for each key is not very big - in most cases less than 5kb.

I have implemented a key / value file cache where I md5 hash the key to determine the file name for the hashed file. I then store it in a directory tree with 256 files at each level in order to avoid having too many files in one directory.

It appears that with this setup HD performance is becoming a bottleneck. Would I be better of with 开发者_JAVA百科using memcached?

APC or similar is not an option since the PHP files are ioncube encoded and it appears they don't play well together.


memcached is a really good choice for this since it's optimized for key/value caching. Otherwise, you can create a RAM disk and save your cached files to that "disk" instead

0

精彩评论

暂无评论...
验证码 换一张
取 消