OpenResty (also known as ngx_openresty) is a full-featured Web application server. It packages the standard Nginx core, many commonly used third-party modules, and most of their dependencies.
By rubbing together many well-designed Nginx modules, OpenResty effectively transforms the Nginx server into a powerful Web application server. Based on it, developers can use Lua programming language to script Nginx core and existing Nginx C modules and build extremely high-performance Web applications that can handle more than 10,000 concurrent requests.
OpenResty is dedicated to fully running your server-side applications on Nginx servers, making full use of Nginx’s event model for non-blocking I/O communications. Not only is the network communication with HTTP clients non-blocking, but also with MySQL, PostgreSQL, Memcached and Redis, and many other remote backends.
Because the maintainer of the OpenResty package is also the author of many of the Nginx modules packaged therein, OpenResty ensures that all the components contained can work reliably together.
This is the second generation of OpenResty, commonly known as ngx_openresty, to distinguish it from the first generation of OpenResty based on Perl and Haskell. Zhang Yichun and his colleague Wang Xiaozhe designed the second generation of OpenResty. Under the proposal of Wang Xiaozhe, the development is based on Nginx and Lua.
Why take the name OpenResty? OpenResty was first adapted to the trend of OpenAPI, so Open came from the meaning of “open” and Resty is the meaning of REST style. Later, any form of web service or traditional web application can also be implemented based on ngx_openresty.
That is to say, Nginx is no longer a simple static web server, nor a simple reverse proxy. The second generation of openresty is dedicated to expanding nginx into a full-featured Web application server through a series of nginx modules.
Ngx_openresty is a user-driven project. Later, many domestic users participated. From the distribution of openresty.org clicks, domestic and foreign clicks are basically the same.
Ngx_openresty currently has two main application objectives:
- Universal purpose web application server. Under this goal, existing web application technologies are more or less similar to OpenResty, such as Nodejs, PHP and so on. The performance of ngx_openresty (including memory usage and CPU efficiency) is one of the biggest selling points.
- Nginx script extension programming is used to build a flexible Web application gateway and Web application firewall. Some are similar to NetScaler. Its advantage lies in the great flexibility brought about by Lua programming.
Ngx_openresty was the product of the company’s actual business needs from the beginning. In the past few years, most of the development work has been driven by the actual business needs of many companies and individuals at home and abroad. This model works very well in practice to ensure that what we do is what we need most urgently. In this process, two major application directions of ngx_openresty are gradually formed, which are the two directions mentioned above. Our users helped us identify these two directions. In fact, this is not the same as the direction of the first generation of OpenResty but is becoming more bottom-level and more general-purpose.
The core of the open source spirit is sharing rather than pursuing popularity. After all, open source is not entertainment, nor fashion. If our open source project is used by more and more people, just a “happy accident”, we will be happy, but this is not what we really pursue.
Open source is only the first step in the life cycle of open source projects. Many domestic open source projects stop at open source, and do not follow up with long-term time and effort to respond to users’needs and feedback, but inevitably die. This phenomenon is also common in many open source projects abroad.
There are many successful open source projects abroad, perhaps related to the mental state of programmers in many developed countries. For example, some foreign hackers I know are very simple-minded and enthusiastic. They have very little mental restraint and do things in a very informal way. Some people will spare no effort to devote themselves to open source projects, even if they have no job for a long time and live solely on mortgages and donations. However, many of the domestic programmers I have come into contact with generally have a heavy mental burden and great economic pressure. Naturally, it is difficult to have the idea of “playing open source”.
However, there are also some programmers in China who have the quality of excellent hackers from abroad, and they are closely linked with hackers from all over the world through the network, so we can fully expect them to have exciting output in the future. In the age of the Internet, it may be more and more inappropriate to discuss such issues according to the division of national boundaries.