Nginx vs Apache

Apache is like Microsoft Word, it has a million options but you only need six.

Nginx does those six things, and it does five of them 50 times faster than Apache.

Apache is a process-based server that means each simultaneous connection requires a thread which experiences significant overhead and they degrade much faster on less powerful hardware or in a resource-restricted environment such as a VPS(Virtual private server).

Nginx is an event-based web server (asynchronous server), that means it handles requests in a single (or at least, very few) threads so it doesn’t need to create new processes or threads for each request like Apache does, so its memory usage is very low. it uses non-blocking I/O to service many requests in each thread.

Apache makes copies (process forks) of itself for every request whether its PHP or a css file. Each running version eats up more RAM. So we have a very low limit on the number of things it can do at one time.

Nginx uses a fixed amount of RAM because it is event driven. so we can use RAM for other things, like PHP.

Apache supports .htaccess files.

Nginx doesn’t support .htaccess files.

Nginx can’t directly serve PHP files like Apache can with mod_php.

150 150 Burnignorance | Where Minds Meet And Sparks Fly!