I installed Nginx Admin (v4.5 Stable) in plugins of WHM. i feel it's making load on server when there a lot of files generated in /tmp/nginx_client/ directory. i want some cronjob which run Temporary Files Cleanup operation automatically. Or is there any predefined action to do this ? Any help would be much appreciated. Thanks
Nginx: Temporary Files Cleanup Automatically
nginx
Related Solutions
Several points:
The major difference between Apache and Nginx or Lighttpd (that I personally very like) is architecture:
- Apache handles one connection per-process or per-thread (depending on mod-XYZ)
- Nginx and Lighttpd are single threaded handle multiple connections in single event loop.
As a result:
Nginx and Lighttpd scales much better under high number of simultaneous connections, let's say with 1000 connections Apache would almost die as it would require 1000 processes in mod-prefork or 1000 threads in mod-worker.
If you are planning to use Comet technologies where each connection requires long polling HTTP connection then Apache would not be acceptable as it does not scales well.
Nginx and Lighttpd consume less memory as each connection require +- two sockets (HTTP and FastCGI), intermediate memory buffer and some state, while Apache would need entire thread including stack and other things.
From my personal experience in benchmarks I did Lighttpd (and I assume Nginx as well) is slightly faster with FastCGI backend then Apache but this is for low amount of connections.
Now another point is when you want to do some load-balancings using FastCGI connections.
In traditional architecture there is
|
HTTP
|
Balancer (Nginx/Lighttpd/Cherooke/something-else)
/ | | | \
HTTP HTTP HTTP HTTP HTTP
/ | | | \
Apache+PHP Apache+PHP Apache+PHP Apache+PHP Apache+PHP
Server 2 Server 3 Server 4 Server 5 Server 6
Because Apache handles pools of processes each of them running mod-PHP (or other modes)
When you using CppCMS that handles pools on its own you can do something different:
|
HTTP
|
Balancer (Nginx/Lighttpd/Cherooke/something-else)
Server 1
/ | | | \
FCGI FCGI FCGI FCGI FCGI
/ | | | \
CppCMS App CppCMS App CppCMS App CppCMS App CppCMS App
Server 2 Server 3 Server 4 Server 5 Server 6
So basically you do not need another indirection level because CppCMS handles process, thread and connection pool for you. While PHP/Ruby/Perl need some Apache mod-XYZ or handle its own FastCGI connector.
The buffering causes problems there, turn it off completely:
proxy_buffering off;
See the official docs for details:
When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. nginx will not try to read the whole response from the proxied server. The maximum size of the data that nginx can receive from the server at a time is set by the proxy_buffer_size directive.
Best Answer
open cron file:
write down the following lines
also tmpwatch can help you.