Frederick L. Steinkopf wrote:

Hi,
How does php handle multiple concurrent fopen fwrite fclose calls? I have a
website that gets 7 million page views a month and we have created a custom
log file using fopen fwrite and fclose. When running this concurrently with
the apache log we notice significantly lower page hits with the php logger. My guess is that we're losing data when the requests come in concurrently. Any advice would be appreciated.
Fred Steinkopf

It sounds as though its the multiple file updates problem. Only one process should be allowed to edit the file at any one time. I suggest you look at flock in the filesystem functions as a means of controlling exclusive access. Other processes need to wait their turn.

With page hits averaging nearly 3 per second, depending upon what you log and what reporting you want from the logs, might a database be considered?

HTH
Chris



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to