Home » questions » Modified Apache custom log & httpd.conf . Will it affect performance?

Modified Apache custom log & httpd.conf . Will it affect performance?

2006-08-12 22:28:02, Category: Programming & Design
To solve the problem of my Apache server log for some domains exceeding the 2GB filesize limit, I've recently added some extra directives to httpd.conf to log images to a separate log. Below is the original entry (CASE 1): CustomLog domlogs/the-domain.com combined Then I've added the "images" directive (CASE 2) SetEnvIfNoCase Request_URI "\.gif$" is_image=gif SetEnvIfNoCase Request_URI "\.png$" is_image=png SetEnvIfNoCase Request_URI "\.jpg$" is_image=jpg CustomLog domlogs/the-domain.com.images combined env=is_image CustomLog domlogs/the-domain.com combined env=!is_image I was considering dumping the images log altogether to dev/null (CASE 3): Question: I'm worried that CASE 2&3 will consume way more resources because it has to do a REGEX for every query. From resource consumption point of view, how will each of the different cases (CASE 1-3) differ from the others and will the difference be significant enough to be worth paying attention to?

Answers

  1. hayral

    On 2006-08-13 03:08:34


    Regex will consume some CPU time, not important if you don't get tens of thousands of hits per day. If you have a higher load its cpu overload may be significant then you could serve your images from another physical server (thus load balancing) or you can set a cron task to copy and delete the log file or better use an apache mod_. Loren Soth