Mako Server provides a super compact and efficient Lua web framework and non-blocking asynchronous sockets in a tiny ready to run application server package. The server includes everything you need: integrated database, SMTP, HTTP client/server, IoT protocols such as MQTT, industrial protocols such as Modbus, and more. The Mako Server is ideal for memory constrained embedded Linux systems.
Lua is a powerful, efficient, lightweight, programming language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description. Learning Lua is easy with the Mako Server's step by step interactive examples.
The Mako Server extends Lua and provides Lua Server Pages, asynchronous sockets, WebSockets, and many additional features.
Lua Server Pages
Lua Server Pages (LSP) is based on the Lua programming language and makes developing web applications extremely fast, simple, safe, and fun. Notably, LSP isn't limited to the development of web applications, but can also be used to provide high-level socket APIs that make developing secure socket applications very easy. Getting started with LSP is especially easy if you have prior experience with similar application server scripting technologies such as PHP.
The Number of the Day Example
<html> <body> <h1> The Number of the Day is <?lsp=ba.rnd(1, 10)?> </h1> </body> </html>
Virtually all other Lua web frameworks are designed as web server plugins and require that you assemble a complete setup. These frameworks have a tendency to be big so if size and speed matters, Mako Server may be a better choice (see below). The Mako Server is based on the Barracuda App Server Library which is optimized for resource constrained systems. A copy of the Barracuda App Server Library's extensive documentation can be found online.
Although the Mako Server is great for small embedded Linux devices, the Mako Server is also a great fit for hosting online web sites on the cheap. With Mako Server you can host anything from static HTML files to advanced server side and database driven web sites.
You can easily install the Mako Server on any online Virtual Private Server (VPS), including Amazon AWS and Microsoft Azure.
Since the Mako Server is so efficient, it can be installed on a $12 a year budget VPS. You cannot even cover the electricity bill for your own hosted 24/7 server for this cost. The reason you have probably not heard about such a low cost setup is that a budget VPS has limited memory, and running a typical application server setup would not be possible on such a limited setup, but that is not a problem for the Mako Server.
Our recommendation is to use the 64MB OpenVZ plan from securedragon. Their servers have virtually zero down time and all of the Virtual Private Servers we have running on their services have uptimes more than a year. With securedragon, you start the VPS and then forget about it.
How many web sites do you think get 5 million page views per month? Not many, but let us assume you aim for that many visitors. How will the Mako Server handle this? Well, 5 million page views per month is 112 pages on average per minute. From the speed test below, you can see that Mako Server can serve 22,000 dynamically generated pages per minute on a super slow device. It suffices to say that the Mako Server can easily handle a huge load on any online VPS.
Many games are designed in Lua and if you already have Lua experience, Mako Server makes the backend hosting for your game easy.
The Mako Server includes a super efficient publish/subscribe protocol called SMQ that is ideal for online gaming infrastructure. The SMQ broker is an integral part of the server. The broker can be extended using the public API, thus making it easy to interface your own messaging infrastructure and Lua server logic with database services.
The Mako Server's included SMQ protocol is ideal for IoT. The following video shows how a device can be controlled from a web browser in real time. The Mako Server acts as a broker for the communication between the browser and the device.
|How to setup your own secure IoT cloud server||ESP8266 Arduino WiFi IoT Device to Cloud Setup|
See the IoT page for more information on the SMQ protocol.
Download the Mako Server for your platform. All downloads include a script that enables you to automatically download and run the tutorials on your own computer. See also the getting started guide for how to run the server using the command line.
An online VPS running the tutorials is also available. You may use the online interactive tutorials by navigating to http://embedded-app-server.info.
We provide an extensive list of written tutorials, which covers everything from Lua development to hosting IoT servers.
The Mako Server and the tutorials are optionally available as a Docker image.
After installing Docker, run the following command in a console window:
After running the command, use your browser and navigate to http://localhost.
To restart the tutorials, run the following command:
The Mako Server is extremely fast at dynamic content generation. We compared the Mako Server delivering dynamically generated Lua Server Pages to the Apache Server delivering static content. We were able to generate dynamic content much faster than Apache could deliver static content.
Two minute speed test on a generation 1 Raspberry Pi (700MHz ARMv6):
The benchmarking should have been performed with other dynamic content frameworks such as PHP, but we were unable to find any reliable benchmarking data. In any event, PHP is slower than static content when run in an Apache server.
The benchmarking was performed with FuguHub, which is another Barracuda Application Server derivative product. The Mako Server and FuguHub will provide the same benchmarking results since they are derived from the same product.
See the FuguHub benchmarking results for details.