Jump to content

Can biz componet get write access to Apache's log


Recommended Posts

Hi there,

 

In this case the biz logic is written in PHP. I am a PHP/Apache newbie so please pardon my ignorance!

 

When we fulfill a web request in PHP we need to log the response into a file for later processing. The response can be anywhere from 2k to 6k. We clocked our PHP app and it services about 60 requests per sec. I tried just creating a file for containing each response, but due to high request volume, we were generating 2,400 files in 400 seconds. This created too much load on the system, plus the resulting number of individual log files (one for each web

request) was unmanageable (not to mention using up all available iNodes or file handles).

 

We figured since Apache is ultra-efficient at logging (like how their access log files get sooo big yet this logging task does not noticeably drag down the server), can we in PHP somehow use Apache's logging service? It would be great if all PHP threads can just somehow pass Apache our log data and have it stash them in one big file (that rolls on some schedule). This way we avoid creating tons of little files, and our PHP threads can effectively share a log file handle without having to serialize (lock/unlock) access to the log file.

 

We've considered throwing these into a DB but can something like MySQL handle this kind of load?

 

Has anyone done this or have ideas or leads?

 

Thanks in advance for your help!

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.