Zhanhailiang Date: 2014-12-02Related dependencies1. Environment deployment
Redis installation configuration tutorial and Phpredis extended installation test
Redis Installation and PHP extensions
The Phpredis module is installed under Windows (the Php_redis.dll in the current window environment is basically 2.1.3, and the redis.so version under Linux has reached 2.2.5, which may lead to diff
memory used by Redis, which contains the memory consumed by the actual cache and the memory (such as metadata, LUA) that the Redis itself runs. It is the memory allocated by Redis using the memory allocator, so this data does not count the amount of memory wasted by memory fragments.Other fields represent the meaning,
: This article mainly introduces the Nginx embedded lua script, which is used in conjunction with Redis. For more information about PHP tutorials, see. 0x00 Nginx embedded Lua script has the following features:
20 k concurrent connections
The Lua script can be used at different layers of the 11 ngnx, and the Ngnix
: This article mainly introduces nginx + lua + redis. For more information about PHP tutorials, see.
Recently, nginx + lua + redis is used as a system to support high-concurrency and high-traffic applications. During development, I suddenly thought about whether golang could achieve the same effect. So I wrote a sim
A system has recently been used with Nginx+lua+redis to support high-concurrency high-traffic applications. Development when suddenly thought Golang can also achieve the same effect. So I wrote a simple code comparison.
Specifically not much to do introduction, online a lot about Nginx+lua+redis building high-con
/nginx/lua/hello.lua
/etc/nginx/lua/hello_redis.lua
/etc/nginx/lua/redis.lua
nginx.conf file Add:
Hello.lua File Contents:
Ngx.header.content_type = "Text/plain";
Ngx.say ("Say Hello from Hello.lua");
All added location codes:
Then re-load Nginx to see the effect.
3. Using Redis (third newly added
Nginx + Lua + redis implement gray release:
Gray release refers to a method for smooth transition between black and white
AB test is a gray release method that allows some users to continue using a and some users to use B. If the user has no objection to B, the scope is gradually expanded, migrate all users to B. Gray release ensures the stability of the entire system. problems can be detected and adjusted
Previous Openresty related articles, but also used to accelerate the speed of the Web page, but the last time did not optimize the code, this finishing, the optimization of nginx configuration and LUA code, interested in the words can look at the article:Https://www.cnblogs.com/w1570631036/p/8449373.htmlIn order to learn, constantly to their server loading things, is Logstash, but also Kafka, causing the main station network load, CPU consumption is t
Background
Recently to carry out the reconfiguration of IVR, we are now connected to three IVR service providers, n business, because IVR this thing generally only external network callback, and the development environment does not allow the extranet casual access,
Really annoying. All we intend to refactor, encapsulate more than IVR, transparent to the business, at the same time callback can be directed to multiple IVR service providers of different callid directly forwarded to the request of
: This article describes how to install nginx + lua + redis. For more information about PHP tutorials, see. Install luajit2.0.2
Wget http://luajit.org/download/LuaJIT-2.0.0-beta9.tar.gz
Tar zxvf LuaJIT-2.0.0-beta9.tar.gz
Cd LuaJIT-2.0.0-beta9
Make
Sudo make install PREFIX =/usr/local/luajit
Install ngx-devel-kit, lua-nginx-module, and echo-nginx-module
Cd/usr/lo
Ngx_lua embeds Lua into nginx and enables nginx to execute Lua scripts to process various requests with high concurrency and non-blocking.
The URL requests the nginx server, Lua queries redis, and returns JSON data.
1. Install LUA-nginx-Module
See lnmlgc Architecture
2. In
://localhost/lua set Result:ok dog:an Aniaml [root @VM_192_107_centos lua]# Curl Http://localhost/lua_mongo name:dog [Root@vm_192_107_centos lua]# In addition, Nginx passes values to LUAJava code Local REQUEST_METHOD = Ngx.var.request_method local args = nil local param = nil local param2 = nil If "G ET "= = Request_method Then args = Ngx.req.get_uri_args () el
Ngx_lua Lua into Nginx, let Nginx run Lua script. High concurrency, non-clogging process for various requests.The URL requires Nginxserver, and LUA queries Redis to return the JSON data.I. Installation Lua-nginx-moduleSee the architecture of LNMLGCTwo. Installing the Redis2-
1. Demand Analysis
There are many ways to handle access control by Nginx, and there are many kinds of effects, such as accessing IP segment, accessing content restriction, accessing frequency limit and so on.Using Nginx+lua+redis to make access restrictions is primarily to take into account the need for fast access control in high concurrency environments.The process of Nginx processing requests is divided
The Redis 2.6.0 built-in Lua script support allows you to run a lot of logic once on the server side of Redis.
The entire script is in one transaction by default.
All the keys involved in the script are passed in as far as possible from the outside, so that Redis knows what key you want to change from the
This article describes how to build high concurrent Web applications with Nginx+lua+redis, curl requests Nginx,nginx to return JSON data through Lua query Redis.
First, installation1. Installation Lua-redis-parser
Copy Code
Objective
Lua is a scripting language known for its performance and is widely used in many ways, especially games. Like "World of Warcraft" plug-ins, mobile games "big Masters" "The Divine Comedy", "The Lost Land" and so on are written in Lua logic.
So most of the time we don't have to think about performance. Knuth
Redis performance problems and Redis performance problems
Redis may cause performance problems and provide corresponding solutions.
1. Blocking of snapshot writing
Solution:
2. AOF Problems
Solution:
3. Memory bottle
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.