相关文章:
- 如何使用Java编写NT服务 2003-02-17 shanhe
- 试用QEMU,安装个FreeBSD 5.3 2004-11-21 9731boy
我读代码读出来的,对应的版本是 memcached-1.2.2 ,大致要支持多线程,在安装的时候必须打开:
./configure --enable-threads
安装完之后,启动的时候看看帮助信息有没有这条:
-t <num> number of threads to use, default 4
如果有,说明已经支持了线程,就可以在启动的时候使用 -t 选项来启动多线程
然后启动的时候必须加上你需要支持的线程数量:
/usr/local/memcache/bin/memcached -t 1024
Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=1780058
评论
建议多少个cpu就用多少个thread
Once you have a thread-capable memcached executable, you can control the
number of threads using the "-t" option; the default is 4. On a machine
that's dedicated to memcached, you will typically want one thread per
processor core. Due to memcached's nonblocking architecture, there is no
real advantage to using more threads than the number of CPUs on the machine;
doing so will increase lock contention and is likely to degrade performance.
不建议用thread