Hello Experts,
Here is the situation...
1 - I have a folder (let's call it the root folder) containing all my mp3s on a Windows XP Pro SP3 (folders named by artists, then subfolders named by albums, then files). You can look at the attachement "diagram.jpg"
2 - An index.php file is located in this directory.
3 - This index.php is processed by an apache webserver (which of course has an alias configured to point to that directory)
4 - The index.php browse recursively the root folder with opendir, readdit and is_dir PHP functions. It diplays all the folders with links to listen to them, etc....
...and here is the problem:
When Apache is located on another Windows box (XP SP3 or Server 2003), the folder is accessed by Apache via a UNC path (\\192.168.5.10\MP3\) and the processing of the whole folder takes approx 30 seconds.
When Apache is located LOCALLY (XP SP3 then), the folder is accessed by Apache via a physisical path (F:\MP3\) and it takes 2 seconds to complete.
When Apache is located on a Linux Box (Ubuntu), the folder is accessed by Apache via a cifs mount (/mnt/mp3mntpoint/) and the processing of the whole folder is almost instant.
I was really puzzled by this siutation, the source server reamins the same (XP SP3 with all mp3s on it), the index.php is then strictly the same. But when being processed by a remote web server it is instant with Linux it takes soooo long with Windows (altough this is their prioritary protocol used between 2 windows boxes!!!). I am currently focusing my search on the readdir/opendir functions and the smb/cifs protocol.
When I network monitor the interface on the XP box containing the MP3s. I can see that there way more SMB traffic when the remote Windows access it than with Linux. I can attach the WireShark capture if you wish. You can reproduce this by using the greatly simplified php script attached (it simply recursively browse the folder).
INTRODUCTORY QUESTION:
Do you agree this is a readdir/opendir and/or cifs/smb protocol issue? At what level?
Is there a way to know what windows functions are called when using readdir?
MAIN QUESTION:
IS THERE A WAY TO HAVE THE WINDOWS REMOTE BOX, BE FASTER (maybe should I say less chatty when chatting with the MP3 box)?
Thanks in advance for your input.
Kind Regards,
Laurent
www.teltip.com