PHP Live! Help Desk
» Help Desk Home » Tips and Tricks » Improve server performance with custom logging conditions
Improve server performance with custom logging conditions

The PHP Live! system contains an ajax/ directory that has several PHP files that are requested frequently by the operator console, visitor chat window and the PHP Live! HTML Code.  The periodic frequent requests performs various tasks to update the operator status, chat status, visitor footprint status and more.  The requests are fast and takes milliseconds to process with minimal CPU usage.  But each request does get logged to the web server log files.

 

For high volume traffic websites, you may want to separate or pause the frequent ajax/ directory from logging to the web server.  If the web server log file gets to large, it will eventually slow down the web server.  This documentation explains how to separate the frequent ajax/ directory requests from being logged to the general apache log files. You will need to setup conditional logging within the Apache conf file.  For web servers other then Apache, the procedures are similar.

 

(Note: For more information on Conditional Logging check out this link... http://httpd.apache.org/docs/logs.html)

 

The concept is to separate the frequent ajax/ folder requests to a new log file.  Essentially, you'll want to stop all logging to the general log file but filter the ajax/ requests to a new log file.

 

Edit your apache httpd.conf file and add the following lines to your virtual host. Keep in mind, your system may have a different directory and log file names.

 

SetEnvIf Request_URI ajax/ ajax

CustomLog logs/access.log common env=!ajax

CustomLog logs/access_ajax.log common env=ajax

 

To pause all logging of the ajax/ directory requests altogether, comment out or do not include the last line from above (CustomLog logs/access_ajax.log common env=ajax).  To separate or pause the entire phplive/ directory, substitute the above ajax/ directory to the phplive/ directory.


You will need to make sure there are no other CustomLog lines specifying the access_log.  Otherwise the two may conflict with each other.  Once your httpd.conf is modified you will need to restart the apache service for the changes to take affect.

Was this documentation helpful to you?
© OSI Codes Inc. All Rights Reserved  /  Privacy Policy  /  License Agreement  /  download live chat icons  /  help desk  /  contact us » follow us on Google+ Google Plus