# Nginx without access log

**URL:** <https://www.ruby-forum.com/t/nginx-without-access-log/214448>\
**Category:** NGINX\
**Created:** [December 2, 2011, 6:56am UTC](https://www.ruby-forum.com/t/nginx-without-access-log/214448 "2011-12-02T06:56:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [December 2, 2011, 6:56am UTC](https://www.ruby-forum.com/t/nginx-without-access-log/214448/1 "2011-12-02T06:56:08Z")

</div>

Obviously nginx needs a time (even very short) to write access and error  
logs upon every request. Thus, theoretically, removing access and error  
logs from nginx configuration should speed up the web server.  
Surprisingly, when I did so, the load of my website became slower. Is it  
normal?

NOTE: I know that logs are useful and needed for real experiences; I  
just try to better understand nginx as my beloved web server 🙂

Posted at Nginx Forum:

> **[Nginx without access log](https://forum.nginx.org/read.php?2,219454,219454#msg-219454)**
>
> Obviously nginx needs a time (even very short) to write access and error logs upon every request. Thus, theoretically, removing access and error logs from nginx configuration should speed up the web server. Surprisingly, when I did so, the load of my...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [December 2, 2011, 7:49am UTC](https://www.ruby-forum.com/t/nginx-without-access-log/214448/2 "2011-12-02T07:49:14Z")

</div>

As I explored, simply removing access\_log and error\_log from nginx  
configuration makes the process for nginx more complicated; thus, it  
takes more time to complete the request. Instead, error\_log should be  
turned off by  
error\_log /dev/null crit;

but how to turn off the access log?

And what is the best configuration to force nginx to conduct the main  
requests without dealing with side process (like creating logs). I want  
to compare the very basic action of nginx.

Posted at Nginx Forum:

> **[Re: Nginx without access log](https://forum.nginx.org/read.php?2,219454,219455#msg-219455)**
>
> Obviously nginx needs a time (even very short) to write access and error logs upon every request. Thus, theoretically, removing access and error logs from nginx configuration should speed up the web server. Surprisingly, when I did so, the load of my...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [December 2, 2011, 8:04am UTC](https://www.ruby-forum.com/t/nginx-without-access-log/214448/3 "2011-12-02T08:04:04Z")

</div>

On Fri, Dec 02, 2011 at 01:48:21AM -0500, etrader wrote:

> As I explored, simply removing access\_log and error\_log from nginx  
> configuration makes the process for nginx more complicated; thus, it  
> takes more time to complete the request. Instead, error\_log should be  
> turned off by  
> error\_log /dev/null crit;
> 
> but how to turn off the access log?

access\_log off;

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [December 7, 2011, 2:09pm UTC](https://www.ruby-forum.com/t/nginx-without-access-log/214448/4 "2011-12-07T14:09:09Z")

</div>

On Friday 02 December 2011 09:55:45 etrader wrote:

> Obviously nginx needs a time (even very short) to write access and error  
> logs upon every request. Thus, theoretically, removing access and error  
> logs from nginx configuration should speed up the web server.  
> Surprisingly, when I did so, the load of my website became slower. Is it  
> normal?

How did you bench it? Did you use ab for your tests?

wbr, Valentin V. Bartenev
