Casbay Knowledge Base

Search our articles or browse by category below

PHP Version + NGINX in WordPress Hosting

Last updated: September 8, 2022
Estimated reading time: 2 min

PHP VERSION + NGINX

You MUST remember to choose NGINX as the web server instead of Apache whenever you change the Apache version to support your website. Please select FPM application served by nginx.

What is NGINX? How does it work?

NGINX, pronounced as “engine-ex,” is a famous open-source web server software. In its initial release, it functioned for HTTP web serving. Today, however, it also serves as a reverse proxy, HTTP load balancer, and email proxy for IMAP, POP3, and SMTP.

It got its official release in October 2004. The creator of the software, Igor Sysoev, started his project in 2002 as an attempt to answer the C10k problem. C10k is the challenge of managing ten thousand connections at the same time. Today, there are even more connections that web servers have to handle. For that reason, it offers an event-driven and asynchronous architecture. This feature makes NGINX one of the most reliable servers for speed and scalability.

Due to its superb ability to handle a lot of connections and speed, many high-traffic websites have been using its service. Some of these online giants are Google, Netflix, Adobe, Cloudflare, WordPress.com, and many more.

How does NGINX work?

First of all, let’s take a look at how a web server works. When someone makes a request to open a webpage, the browser contacts the server of that website. Then, the server looks for the requested files for the page and sends them to the browser. This is only the simplest kind of request.

The example above is also considered as a single thread. Traditional web servers create a single thread for every request, but NGINX does not work that way. As stated before, it performs with an asynchronous, event-driven architecture. It means that similar threads are managed under one worker process, and each worker process contains smaller units called worker connections. This whole unit is then responsible for handling request threads. Worker connections deliver the requests to a worker process, which will also send it to the master process. Finally, the master process provides the result of those requests.

That may sound simple, but one worker connection can take care of up to 1024 similar requests. Because of that, it can process thousands of requests without any difficulties. This is also the reason why it became excellent for busy websites like e-commerce, search engines, and cloud storage.

Before reading further think about the most innovative hosting structure that you might need for your website. Casbay is offering shared hosting, VPS, and dedicated server hosting for small and ready-to-grow big websites.

NGINX vs Apache

Among popular web servers, Apache is one of the main rivals for NGINX. It has been around since the 90s and has a large user community as well. If you are curious about which web server is best for your needs, take a look at this brief and informative comparison between these two.

OS support

Compatibility is one of the few details you should consider when choosing software. Both web servers can run on many operating systems that support the Unix system. Unfortunately, NGINX’s performance on Windows is not as great as on other platforms.

User support

Users, from first-timers to professionals, always need a good community that can help when they face problems. While both NGINX and Apache have mailing support and a Stack Overflow forum, Apache lacks support from its company, the Apache Foundation.

Performance

NGINX can simultaneously run 1000 connections of static content two times faster than Apache and uses a little less memory. When compared for their performance on running dynamic content, however, both have the same speed. NGINX is a better choice for those who have a more static website.

Conclusion

NGINX is a web server that also acts as an email proxy, reverse proxy, and load balancer. The software’s structure is asynchronous and event-driven; which enables the processing of many requests at the same time. NGINX is highly scalable as well, meaning that its service grows along with its clients’ traffic. NGINX and Apache are indeed two of the best web servers in the market.

Was this article helpful?
Dislike 0
Previous: HOW TO: Manage categories in WordPress
Next: HOW TO: Add a WordPress logout link to a menu
Have questions ? Search our documentations.