[wp-hackers] Incredibly High PHP Creation Times on WP SVN?

Omry Yadan omry at yadan.net
Fri Oct 5 07:07:39 GMT 2007


obviously you can.

flock take a file handler as argument, and will block if the file is locked.

I don't think fopen or even fwrite cares if a file is locked, it's up to
the developer to protect access to the file using flock.

in this case, you can see that flock is trying to lock the file
exclusively after it's open.



DD32 wrote:

> On Fri, 05 Oct 2007 16:47:03 +1000, Omry Yadan <omry at yadan.net> wrote:
>   
>> Getting a file lock can potentially take a very long time, if other
>> processes are holding the lock for a long time.
>> this may be a symptom caused by another problem.
>> _______________________________________________
>>     
>
> It can potentially take a long time if someone else has it locked.. But I didnt think you could open a file(for writing) if its locked?
>
> The Object cache locking function:
> 	function acquire_lock() {
> 		// Acquire a write lock.
> 		$this->mutex = @fopen($this->cache_dir.$this->flock_filename, 'w');
> 		if ( false == $this->mutex)
> 			return false;
> 		flock($this->mutex, LOCK_EX);
> 		return true;
> 	}
>
> The object cache can slow your site down significantly if your using a non-local(eg Network or SAN) filesystem, Or if you've got high IO load on the server, Thats why it isnt enabled by default. However it can be a great speed boost if your MySQL server has speed issues.
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>   



More information about the wp-hackers mailing list