All Projects → kingluo → Luajit.io

kingluo / Luajit.io

Licence: bsd-2-clause
luajit io framework

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Luajit.io

Apioak
Full Lifecycle Management API Gateway.
Stars: ✭ 335 (+20.94%)
Mutual labels:  openresty, luajit, nginx
Lua Resty Repl
Interactive console (REPL) for Openresty and luajit code
Stars: ✭ 165 (-40.43%)
Mutual labels:  openresty, luajit, nginx
Lua Resty Redis Connector
Connection utilities for lua-resty-redis
Stars: ✭ 186 (-32.85%)
Mutual labels:  openresty, luajit, nginx
Lua Resty Post
HTTP post utility for openresty
Stars: ✭ 30 (-89.17%)
Mutual labels:  openresty, luajit, nginx
Lua Resty Route
URL Routing Library for OpenResty Supporting Pluggable Matching Engines
Stars: ✭ 88 (-68.23%)
Mutual labels:  openresty, luajit, nginx
Motan Openresty
A cross-language RPC framework for rapid development of high performance distributed services based on OpenResty.
Stars: ✭ 117 (-57.76%)
Mutual labels:  openresty, luajit, nginx
Lua Resty Http
Lua HTTP client cosocket driver for OpenResty / ngx_lua.
Stars: ✭ 1,647 (+494.58%)
Mutual labels:  openresty, luajit, nginx
Api Umbrella
Open source API management platform
Stars: ✭ 1,735 (+526.35%)
Mutual labels:  openresty, luajit, nginx
Oneinstack
OneinStack - A PHP/JAVA Deployment Tool
Stars: ✭ 1,983 (+615.88%)
Mutual labels:  openresty, nginx
Lua Resty Jit Uuid
Fast and dependency-free UUID library for LuaJIT/ngx_lua
Stars: ✭ 169 (-38.99%)
Mutual labels:  openresty, luajit
Nginx Admins Handbook
How to improve NGINX performance, security, and other important things.
Stars: ✭ 12,463 (+4399.28%)
Mutual labels:  openresty, nginx
lua-resty-maxminddb
A Lua library for reading MaxMind's Geolocation database
Stars: ✭ 72 (-74.01%)
Mutual labels:  luajit, openresty
Upyun Resty
UPYUN's open source software for OpenResty development
Stars: ✭ 150 (-45.85%)
Mutual labels:  openresty, nginx
Ngx Oauth
OAuth 2.0 proxy for nginx written in Lua.
Stars: ✭ 146 (-47.29%)
Mutual labels:  openresty, nginx
Lnmp
LEMP stack/LAMP stack/LNMP stack installation scripts for CentOS/Redhat Debian and Ubuntu
Stars: ✭ 2,488 (+798.19%)
Mutual labels:  openresty, nginx
Lua Resty Auto Ssl
On the fly (and free) SSL registration and renewal inside OpenResty/nginx with Let's Encrypt.
Stars: ✭ 1,786 (+544.77%)
Mutual labels:  openresty, nginx
Orange
OpenResty/Nginx Gateway for API Monitoring and Management.
Stars: ✭ 2,208 (+697.11%)
Mutual labels:  openresty, nginx
Lua Resty Mlcache
Layered caching library for OpenResty
Stars: ✭ 274 (-1.08%)
Mutual labels:  openresty, luajit
phi
an api-gateway based on openresty
Stars: ✭ 23 (-91.7%)
Mutual labels:  luajit, openresty
lua-resty-ipcidr
A simple and very fast function to check against CIDR
Stars: ✭ 17 (-93.86%)
Mutual labels:  luajit, openresty

luajit.io

Introduction

Pure Lua IO framework, with C efficiency due to its simple but powerful design, and, of course, thanks to luajit, the perfect JIT engine. The HTTP Server is out-of-the-box, which simulates the functionalities and performance of nginx and ngx_lua. Moreover, it could be used to develop generic TCP/UDP server.

Why reinvent the wheel? Well, the nginx and ngx_lua is renowned at efficiency and extensible, but they are written in C language, so you need to be as smart as the authors to contribute codes. What if the core is written in pure lua language, but without any efficiency tradeoff? Then not only the web apps are extensible, but also the server core is extensible at ease by any levels of developers!

The Luajit is a perfect JIT engine to improve lua performance, so with dedicated and luajit-oriented design, the luajit.io would reassemble the advantages of nginx and ngx_lua, but provides extra benefit: simple and extensible at the core.

See the http://luajit.io for demo.

API compatible with ngx_lua (Work In Progress)

It provides seamless ngx_lua API, so third-party openresty libraries could be used in luajit.io without porting.

Tested libraries:

  • lua-resty-lock
  • lua-resty-upload
  • lua-resty-http
  • lua-resty-dns
  • lua-resty-redis
  • lua-resty-mysql
  • lua-resty-postgres

Supported Platforms

Only supports Linux on x86 or x64.

The luajit.io uses linux-specific features, e.g. epoll, signalfd, timerfd, inotify, etc.

Dependencies

  • openssl
  • zlib
  • pcre

On Debian Linux, you should install the dev packages of them, which contains the required *.so links:

apt-get install zlib1g-dev libssl-dev libpcre3-dev

On Centos Linux:

yum install zlib-devel pcre-devel openssl-devel

Status

This library is considered experimental and still under active development.

And there is still big room to improve the performance, by increasing the jit compiled ratio, which is really a tough job.

Welcome to join and help!

QuickStart

install luajit

wget https://luajit.org/download/LuaJIT-2.1.0-beta3.zip
unzip LuaJIT-2.1.0-beta3.zip
cd LuaJIT-2.1.0-beta3
make install
ln -sf luajit-2.1.0-beta3 /usr/local/bin/luajit

http server

Just like the API compatibility, the luajit.io configuration simulates the nginx.conf, so most directives are copied from there. See conf/httpd.lua for example.

Copy the example into new file, e.g. conf/myhttpd.lua, and adjust the content according to your need.

Then just run it:

luajit conf/myhttpd.lua

generic tcp server

It contains a simple socks5 server, as the generic tcp server demo.

LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 luajit conf/socks5.lua

Note that by default, the luajit is not compiled with -lpthread, which would cause multi-threading usage crash.

See https://sourceware.org/bugzilla/show_bug.cgi?id=10652 for detail.

The async DNS resolving uses multi-threading, so either re-compile the luajit or use LD_PRELOAD before running it.

You should locate the correct version of libpthread.so on your box.

locate libpthread.so
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].