Memcached 是一套高性能分布式内存对象高速缓存系统,用于动态 Web 应用减轻数据库负载以提高动态 web(如 WordPress)响应速度。Memcached 通过在内存中缓存数据和对象来减少数据库查询次数提高动态、数据库驱动网站的速度。
Memcached 简介
Memcached 官网:http://www.memcached.org
「Debian 11 + OneinStack 如何调整 memcached 内存大小?:https://uxtt.com/7」What is Memcached?
Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its API is available for most popular languages.
「Debian 11 + OneinStack 如何调整 memcached 内存大小?:https://uxtt.com/7」相关资料:PHP 手册 Memcached
Debian 11 如何调整 memcached 内存大小?
昨天在 CloudCone 买了个个美国 VPS 服务器,使用 CentOS 7 系统,加 OneinStack 搭建 LNMP 环境,试了两次,memcached 都无法启动,后来换 Debian 11 就可以了。
Debian 11 + OneinStack 如何调整 memcached 内存大小?或者调整连接数等?
「Debian 11 + OneinStack 如何调整 memcached 内存大小?:https://uxtt.com/7」修改 /usr/lib/systemd/system/memcached.service 文件:
[Service]
Environment=PORT=11211
Environment=USER=memcached
Environment=MAXCONN=1024
Environment=CACHESIZE=192
Environment=OPTIONS="-l 127.0.0.1"
ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS
MAXCONN 为最大连接数、CACHESIZE 为内存大小,根据实际环境调整,修改完成保存。然后执行下面代码重启 memcached 即可:
「Debian 11 + OneinStack 如何调整 memcached 内存大小?:https://uxtt.com/7」systemctl daemon-reload
systemctl restart memcached
systemctl status memcached
其它相关文章:VPS 启用 Memcached 动态缓存数据库 优化加速 WordPress 博客
任何服务、机场均有跑路风险,请注意防范!没有啥绝对好坏,一线机场也会炸,小机场也可能岁月静好! 备用节点参考:大哥云官网、万城专线官网、飞机云官网、搬瓦工JMS、极客云官网……
本文已于 2024-06-05 修改更新,您的宝贵建议请在文章下方评论区留言反馈,谢谢。
Comments:0