Hi there,
In this case the biz logic is written in PHP. I am a newbie to Apache so please excuse 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.
Has anyone done this or have ideas or leads?
Thanks in advance for your help!
In this case the biz logic is written in PHP. I am a newbie to Apache so please excuse 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.
Has anyone done this or have ideas or leads?
Thanks in advance for your help!