OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 运用、Web 做事和动态网关。
OpenResty® 通过汇聚各种设计精良的 Nginx 模块(紧张由 OpenResty 团队自主开拓),从而将 Nginx 有效地变成一个强大的通用 Web 运用平台。这样,Web 开拓职员和系统工程师可以利用 Lua 脚本措辞调动 Nginx 支持的各种 C 以及 Lua 模块,快速布局出足以胜任 10K 乃至 1000K 以上单机并发连接的高性能 Web 运用系统。
OpenResty® 的目标是让你的Web做事直接跑在 Nginx 做事内部,充分利用 Nginx 的非壅塞 I/O 模型,不仅仅对 HTTP 客户端要求,乃至于对远程后端诸如 MySQL、PostgreSQL、Memcached 以及 Redis 等都进行同等的高性能相应。

安装
#环境依赖yum install readline-devel pcre-devel net-snmp rsync ntpdate openssl-devel gcc lrzsz unzip perl epel- httpry bmon -y#下载源代码包和解压安装编译curl -o openresty-1.15.8.3.tar.gz https://openresty.org/download/openresty-1.15.8.3.tar.gztar -xvf openresty-1.15.8.3.tar.gzcd openresty-1.15.8.3./configure --without-http_redis2_module --without-http_redis_module --with-http_iconv_module --with-http_realip_module --with-http_addition_module --with-http_image_filter_module --with-http_sub_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --without-http_memcached_module --with-file-aio --with-threads --with-poll_module --without-lua_resty_memcached --with-http_slice_module --with-http_stub_status_module --with-http_v2_module --with-http_slice_module make install
系统配置优化调度
service firewalld stop;chkconfig firewalld offsed -i 's#SELINUX=enforcing#SELINUX=disabled#' /etc/sysconfig/selinux vi /etc/sysctl.conf fs.file-max=65536kernel.panic = 5net.core.netdev_max_backlog = 262144 net.core.rmem_default = 16777216 net.core.rmem_max = 16777216 net.core.somaxconn = 511net.ipv4.conf.all.arp_notify = 1net.ipv4.ip_local_port_range = 1024 65535net.ipv4.tcp_fin_timeout = 1 net.ipv4.tcp_max_orphans = 262144 net.ipv4.tcp_max_syn_backlog = 262144 net.ipv4.tcp_max_tw_buckets = 640000net.ipv4.tcp_slow_start_after_idle=0net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syncookies = 1net.ipv4.tcp_syn_retries = 2 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_window_scaling=1vm.overcommit_memory = 1adduser www;mkdir -p /home/web/proxy/cache/public-datachown www:www /home/web/ -R