OpenResty和Resis一些基本的性能配置

 Basics:

1. Ensure that you have not disabled Lua code cache:
https://github.com/openresty/lua-nginx-module#lua_code_cache

2. Load resty.core:
https://github.com/openresty/lua-resty-core#synopsis

3. Check that you are using Redis connection pools:
do not call this: https://github.com/openresty/lua-resty-redis#close
call this: https://github.com/openresty/lua-resty-redis#set_keepalive

4. Use unix sockets instead of TCP sockets if possible (e.g.. Redis is on the same machine)

5. Use Redis pipelines:
https://github.com/openresty/lua-resty-redis#init_pipeline

6. Cache Redis data in OpenResty shared dict and also to Lua module level (preload data in init_*s):
https://github.com/openresty/lua-nginx-module#lua_shared_dict
https://github.com/openresty/lua-nginx-module#ngxshareddict
https://github.com/openresty/lua-resty-lrucache

(there are some projects like https://github.com/hamishforbes/lua-resty-tlc that might come handy).

... and also make look for adjusting Nginx confs and Kernel settings.

posted @ 2016-10-10 09:21  LisPythoniC  阅读(432)  评论(0编辑  收藏  举报