How to configure an elegant Lua Development EnvironmentDiscussion topic
What is an elegant development environment?
How to deploy the Service (this article discusses the MacOSX platform, which is also applicable to other platforms)
Elegant Lua Development Environment
The elegant Lua development environment includes at least the following:
Install the latest stable edition Lua
Install the appropriate Lua Package Manager (Luarocks is recommended for installation)
Source code installation (
Discussion of how an elegant development environment is deployed (this article discusses the same for other platforms in the MACOSX platform) elegant LUA development environment
The elegant LUA development environment includes at least the following: Install the latest stable version of Lua suitable for your needs, install the appropriate LUA Package Manager (recommended for Luarocks, install in another article) source installation (Reasonable organization installation directory, setting enviro
Choose Go is also abuse not to be, various cautious avoid GC. In most extreme cases, the performance of PyPy is sufficient, and I don't think it is sufficient.
Python's Gil leads to the inability to really multi-threading, and everyone might say I'm not going to end up with multiple processes. However, if some computations involve multi-process interaction, the communication overhead between processes has to be considered.
In fact, Python has a macro that can bypass the GIL, but the a
overall machine load.
But even if we use multiple Django processes to handle HTTP requests, Python still can't handle some of the extra requests. So we use Openresty to implement high-frequency HTTP requests using LUA. This in turn leads to the use of two development languages, and some logic has to write two different codes.
If that's true, you're still using Gateway written five years ago? The traffic distribution layer based on the Django r
Operating system version: Ubuntu 12.04 64bit
Log into the system using the root account to create the relevant directory
Download Store Path
/home/ubuntu/down
installation directory
/usr/local/php #install php-5.4.3
/usr/local/mysql #install mysql5.5.25
/usr/local/openresty #ngx_openresty -1.0.15.9
/usr/local/redis #2.4.14
Store
/storage/redis
Configuration file path:
PHP Configuration
/usr/local/php/etc/php/php.ini
/usr/local/php/etc/ph
OneinStack1.3 is released. one-click PHPJAVA installation tool OneinStack 1.3 is released. this script is written using shell, to quickly deploy lnmp/lamp/lnmpa/lnmt (Linux, Nginx/Tengine/OpenResty, MySQL/MariaDB/Percona, PHP, Apache, and Tomcat) in the production environment, it is applicable to CentOS 5 ~ 7 (including redhat), Debian 6 ~ 8. Ubuntu 12 ~ 16 32-bit and 64-bit.
You can freely combine the following options as needed:
Lnmp (Linux
/fdfs/storage.confFastdfs Configuring Nginx Modules
Package
version
Openresty
v1.13.6.1
Fastdfs-nginx-module
v1.1.6
Fastdfs the file is stored on the Storage server through the Tracker server, but file replication is required between the same set of storage servers and there is a problem of synchronization latency.Assuming the Tracker server uploads the file to 192.168.1.1
Previous wordsThe author is Golang brain remnant powder, this content may cause phper discomfort, please read carefully!Two days ago a colleague encountered a problem, need a can support upload, download the function of the HTTP server to do a data center. I just did, so I promised to give him a lift.HTTP server, the first thought is PHP + nginx. So open the first, write a PHP uploadAll right, write it! The demand is complete! Test it out!So start the first test, the result: Failure!The reason i
First we choose to use Openresty, which consists of a nginx core plus a number of third-party modules, the biggest bright spot is the default integration of the LUA development environment, so that nginx can be used as a Web server. With Nginx event-driven models and non-blocking IO, high-performance Web applications can be implemented. And Openresty provides a large number of components such as MySQL, Redi
first is not your other services, but this API gateway.At this time, usually we will find some open Source API Gateway project, the blogger has already found you, the community of the API Gataway project has the following:Tyk:tyk is an open source API gateway that is fast, extensible, and modern. Tyk provides an API management platform that includes API gateways, API analytics, developer portals, and API management dashboards. Try is a gateway service based on GO implementation.Kong:kong is an
in the transmission process format, the official website package only binary transmission protocol TBinaryProtocol. lua. 3. In the package on the official website, socke is implemented based on lua, while openresty is actually implemented based on luajit. The socket of luajit is ngx. socket. tcp (), which may cause some conflicts.
Here the use of http://www.cnblogs.com/voipman/p/5365248.html mentioned in this Article source code implementation, witho
quotation marks, and import of sed replacements from the terminal through the stdin of the input plug-in.
plug-in name: Multilline ( https://www.elastic.co/guide/en/logstash/current/plugins-codecs-multiline.html input{stdin{ codec=>multiline{ patterns_dir=>["/xm-workspace/xm-apps/logstash/vendor/bundle/jruby/1.9/ Gems/logstash-patterns-core-4.0.2/patterns "] pattern=> "^%{year}/%{monthnum2}/%{monthday}%{time}" negate=>true what=> "Previous" }}}output{stdout{ codec=>rubydebug}} 2016/
Move log files Firstmv/usr/local/openresty/nginx/logs/access.log/usr/local/openresty/nginx/logs/access.log.20161024Send signal to reopen log fileKILL-USR1 $ (cat/usr/local/openresty/nginx/logs/nginx.pid)Simply explain:1, before the execution of KILL-USR1 ' cat ${pid_path} ', even if the file has been the MV command has only changed the name of the file, Nginx wil
Nginx provides the-s signal command-line arguments to let us manipulate them. We can easily specify a boot path using the-p prefix parameter to start multiple fully isolated master processes, or you can explicitly specify a different configuration file using-c filename.Because prefix paths are generally long, reload or reopen Nginx master processes are more inconvenient. Can I use Openresty in OS X at this point? 3. Simplifies these operations by the
Kong is the Mashape open source high performance High Availability API gateway and API Service Management layer. It is based on Openresty, implements API management, and provides AOP for plug-in implementation APIs. Kong manages more than 15,000 APIs in Mashape and provides 200,000 developers with billions of per month of requests for support. This article will introduce Kong from three levels of architecture, API management, and plug-ins.Architecture
application code is more concise.
This is just three simple examples of using Nginx+lua extensions. There are other examples of how simple and powerful your API is just to highlight the use of Nginx+lua.
Let's start by doing something practical ...
Using LUA to extend Nginx
We assume that you should have an understanding of Nginx basic concepts (servers, locations, etc.)
Extension Nginx We must first provide LUA support, which is not part of the Ngnix. We don't have to worry because many c
Install API Gateway Kong (https://getkong.org/) need to install Openresty and PostgreSQL First, here on my installation of the problems encountered and solutions to record, for your reference.
Openresty installation is very smooth, here simply paste:
Yum install-y pcre-devel openssl-devel gcc curl zlib zlib-devel
./configure--with-pcre-jit--with-ipv6--with-http_ Realip_module--with-http_ssl_module--with-h
Previous words
The author is Golang brain remnant powder, this content may cause phper discomfort, please read carefully!
Two days ago a colleague encountered a problem, need a can support upload, download the function of the HTTP server to do a data center. I just did, so I promised to give him a lift.
HTTP server, the first thought is PHP + nginx. So open the first, write a PHP upload
All right, write it! The demand is complete! Test it out!
So start the first test, the result: Failure!
The r
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.