Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just thinking here from performance perspective that maybe turning access_log off; for my websites would improve the loading speed (even though it could be very minimal) but yea anyway how could access_log come in handy really cause I have checked the access logs like twice in my life time?

share|improve this question
up vote 3 down vote accepted

The access_log can be helpful for statistics (it is usually necessary for packages such as awstats or webalizer). Depending on your objectives, you may wish to disable the access_log for small files (e.g. .ico) or based on filename.

For instance, for me, I do not run statistics for static files, and I use nginx as a proxy to apache. Therefore, I disable the access_log for select static file types, as well as for dynamic (php) files (since apache logs those).

The following is a sample of my config file:

    location ~  \.(jpg|jpeg|png|gif|swf|ico|js|css|txt|htm|html|xml|bmp|pdf|doc|docx|ppt|pptx|zip)$     {
        expires     30d;
        access_log off;

    location ~ \.php$ {
        access_log off;

In terms of performance, the gains should really be minimal. Nginx is a very efficient web-server, and unless you are really serving a large volume of pages/files, you are unlikely to notice the difference. The possible advantage though is that your logs won't fill up quite as much with entries you are not interested in. Ideally, you should combine a more targeted log (only the entries you want) with log-rotate, so that you can compress and get rid of older log entries.

share|improve this answer
Yea, I use nginx as proxy for apache and static server for static content too. I guess I'll disable then the access log. Thanks! – Rihards Jul 4 '11 at 14:18
2 quick additional points - i) access logs can be helpful for diagnostics (e.g. if your server is compromised, a particular page is being maliciously targetted etc - it will provide IP data as well as timeline data that can be very helpful. ii) You can disable/enable the logs on a per-directory/per-site basis; for instance, the above configuration is from my 'global' config file. I have other per-site configs that override that, or are more specific. – cyberx86 Jul 4 '11 at 14:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.