stat(), NFS shares and local files timeout
am 07.04.2010 16:27:54 von Igor Feghali
I am running with an issue with remote filesystems (mounted via NFS)
and PHP's stat() / filemtime().
Sometimes when the remote filesystem (NFS share) is busy, my PHP
daemon just hangs forever on a filemtime() call to a file inside this
FS. I failed to find a proper way of setting a timeout for that kind
of operation. Everything I can think of is related to remote files
(URLs) and/or content operations (read/write). Streams for example,
don't even have any options for "local" files and
"default_socket_timeout" directive is applicable only for sockets.
I could fork my daemon just to do a stat() call and control the
running time (timeout) inside the parent process, but I usually stat
60 files / second, so that would be a lot of forking. I prefer to go
another way. anyone has a clue ?
PS: I appreciate if replies go CC'ed to me
Best,
~IF.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: stat(), NFS shares and local files timeout
am 07.04.2010 16:49:42 von Dan Joseph
--00163630f3971f9e1c0483a6aca2
Content-Type: text/plain; charset=ISO-8859-1
On Wed, Apr 7, 2010 at 10:27 AM, Igor Feghali wrote:
> I am running with an issue with remote filesystems (mounted via NFS)
> and PHP's stat() / filemtime().
>
> Sometimes when the remote filesystem (NFS share) is busy, my PHP
> daemon just hangs forever on a filemtime() call to a file inside this
> FS. I failed to find a proper way of setting a timeout for that kind
> of operation. Everything I can think of is related to remote files
> (URLs) and/or content operations (read/write). Streams for example,
> don't even have any options for "local" files and
> "default_socket_timeout" directive is applicable only for sockets.
>
> I could fork my daemon just to do a stat() call and control the
> running time (timeout) inside the parent process, but I usually stat
> 60 files / second, so that would be a lot of forking. I prefer to go
> another way. anyone has a clue ?
>
What if you simply set the script to time out? Is it ignoring that too?
set_time_limit( seconds )
--
-Dan Joseph
www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo
Code "NEWTHINGS" for 10% off initial order
http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry
--00163630f3971f9e1c0483a6aca2--