logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: slow serving a file
Author
xv920



Joined: 28 Feb 2006
Posts: 7
Location: Sunnyvale, California USA

PostPosted: Tue 28 Feb '06 0:58    Post subject: slow serving a file Reply with quote

I was using Apache2 on Cygwin before.
Now I just switched to the native Win32 version of Apache2.

I have this html file that hasn't been updated for a long time.
Everything was fine with this html file before, now isn't.

The html file has a lot of hyperlinks: each points to an .mpg file that
resides on the same disk drive that the html file does. Each mpg file
is referred using a relative path from the html file like for example
<a href="video/0001.mpg">.

To view the page on the web browser, the address column goes like
"http://localhost/some/location/this.html".

If I click any of the links in it, Windows Media Player opens up and
starts playing the mpg file....immediately before, now dead slow like
in 5 minutes!

I realized that if I changed the reference using "file://" like
<a href="file://C/some/absolute/path/0001.mpg">,
then it would play it immediately just like before.
But otherwise it would look as if it hangs or something
if I click any link to an mpg file in it.

In the apache log file, I see the Status 206, Partial Success.
I don't know if that matters. I don't know if it was like that before.

Those mpg files are mostly less than a GB like 250MB. Some exceed 2GB.
But the size doesn't seem to matter. Exactly the same result for any one.

Why slow serving a local file? Any help appreciated. Thanks.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Tue 28 Feb '06 8:08    Post subject: Reply with quote

You say you are using 'native Win32 version of Apache2'.

Where did you get your copy?

I have seen what you are talking about before. If I remember, the solution involved paths inside the Apache CONF.

Are the MPG files located within the root or are they located in another folder outside of the root?

If in another folder, how do you have access setup to that or those folders?
.
Back to top
xv920



Joined: 28 Feb 2006
Posts: 7
Location: Sunnyvale, California USA

PostPosted: Tue 28 Feb '06 9:24    Post subject: Reply with quote

I think I downloaded from apache.org. The exact file name is
apache_2.0.55-win32-x86-no_ssl.exe and I got it from
http://mirrors.playboy.com/apache/httpd/binaries/win32/.

Actually, in the directory where the html file exists, there are
a bunch of directories and each one contains one mpg file.

This directory resides on a different drive than the doc root.
It is aliased using the Alias directive.

So, it's like httpd.conf has

Alias /mediafiles "e:/media"

and in e:/media, there are such directories like "audio" and "video"
and in "video" there is this html file and a lot of subdirectories where
one mpg file resides in each.


Thanks for your help.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Tue 28 Feb '06 20:08    Post subject: Reply with quote

Try using a trailing slash after the actual path.

Ex.:

You have - Alias /mediafiles "e:/media"

Do this - Alias /mediafiles "e:/media/"

I think this might solve your problem.

MHO - Steffen's build is compiled with MS C++, and I have found that it actually runs better (performance and stabilty) than what ASF provides. He does not provide an MSI file, but it is very easy to install and setup.
.
Back to top
xv920



Joined: 28 Feb 2006
Posts: 7
Location: Sunnyvale, California USA

PostPosted: Wed 01 Mar '06 4:55    Post subject: Reply with quote

The trailing slash didn't work.

Here is the log.
-----
127.0.0.1 - - [28/Feb/2006:18:43:59 -0800] "GET /mediafiles/****/****.php HTTP/1.1" 200 40230
127.0.0.1 - - [28/Feb/2006:18:44:11 -0800] "GET /mediafiles/****/****/****.mpg HTTP/1.1" 200 281673728
127.0.0.1 - - [28/Feb/2006:18:44:14 -0800] "GET /mediafiles/****/****/****.mpg HTTP/1.1" 206 281665536
127.0.0.1 - - [28/Feb/2006:18:44:14 -0800] "GET /mediafiles/****/****/****.mpg HTTP/1.1" 206 281636864
-----

Actually, the first one that succeeded with Status 200 has the correct size
of the file. What are the following two 206s with a little bit taken off?
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Wed 01 Mar '06 8:33    Post subject: Reply with quote

A 206 Status Code indicates that the server has fulfilled the partial GET request for a resource. The request MUST have included a Range (or IF-Range) header - Or - you could have cancelled before the transfer was complete.

Are you running some form of Cache or an optimizer?
.
Back to top
xv920



Joined: 28 Feb 2006
Posts: 7
Location: Sunnyvale, California USA

PostPosted: Wed 01 Mar '06 17:41    Post subject: Reply with quote

Not that I know of.

I just click the link(to the mpg file) on the web page on IE, then it opens
up Windows Media Player immediately(but doesn't start playing).

I don't know how IE or WMP composes an http request.

It just seems odd to me that the GET request should be fulfilled with
the first attempt because it succeeded with Status 200 with a right size,
but somehow two more GET requests coming and being fed partially....
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Wed 01 Mar '06 18:59    Post subject: Reply with quote

xv920 wrote:

I just click the link(to the mpg file) on the web page on IE, then it opens
up Windows Media Player immediately(but doesn't start playing).


It never plays or you have that the (part)file is downloaded and then plays ?

Steffen
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Wed 01 Mar '06 19:26    Post subject: Reply with quote

CND - Cannot Duplicate

I used a similiar method of accessing large MP3 files (200+MB) that you do (at least from what you have indicated), but it serves it up every time for me.

At this point, I would have to see the CONF file, directory/folder layout (Tree), and the HTML or PHP file(s) that is being problematic. Since this is an Apache Info/Help Me site...only the CONF (and Tree Layout) would be appropriate.

Per PHP: I would check the HTML that is being produced by the PHP file. It might give an indicator of what is happening (i.e. - it might be producing HTML that you are not expecting).

Need more INFO.
.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Wed 01 Mar '06 20:03    Post subject: Reply with quote

Try a quick test as follows:

1. Create a folder under the root named test (or whatever)
2. Copy over 2 or 3 of your large MP3 files to the new folder
3. Create a simple HTML file named test.html (or whatever you want) with anchors (links) to the MP3 files

Now, start Apache and navigate to localhost/test/test.html

Does the same thing happen?
Back to top
xv920



Joined: 28 Feb 2006
Posts: 7
Location: Sunnyvale, California USA

PostPosted: Wed 01 Mar '06 22:42    Post subject: Reply with quote

Thanks for helping me. I really appreciate your help.

I tested with test.html in the DocRoot.
Exactly the same result. Clicking the link immediately invokes WMP,
but WMP doesn't start playing immediately.

(Remember, the same mpg file starts playing immediately if you
refer to it with the "file://" prefix)

Last time I did it, it took about 5 minutes to start playing.
I didn't make sure this time that it does start. I waited about 30 secs,
and killed it because it didn't start playing.

As I said in the first post, it was playing immediately before
without the "file://" prefix.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Wed 01 Mar '06 23:07    Post subject: Reply with quote

Be aware that Apache is not a streaming server. You have to use for example http://www.umediaserver.net/ (they have a free version I use).


When you do not use a steaming server, look at www.spartanicus.utvinternet.ie/streaming.htm


Steffen
Back to top
xv920



Joined: 28 Feb 2006
Posts: 7
Location: Sunnyvale, California USA

PostPosted: Thu 02 Mar '06 0:35    Post subject: Reply with quote

It was working before, WITH Apache2.

I just switched it from the Cygwin version to Native Win32 version.

Clicking the link to an mpg file immediately invoked WMP and it
immediately started playing. That was before. With Apache2.
Without referring to it with "file://".

That shouldn't happen, you say?
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Thu 02 Mar '06 20:48    Post subject: Reply with quote

First,
Steffen is correct, if you are wanting a high capacity steam server - you should refer to his links.

Second,
The 'simple test' was designed to not only eliminate PHP, but also the ALIAS as well. In other words, is this just Apache acting up or is it some other interaction.

Finally, if you want to continue trying to make this work - Someone is going to have to be able to see your CONF file. Please, do not X out your paths - if for the sake of security you are not comfortable showing your actual paths, then use 'bogus' paths (as long as they are consistent with the structure that you use).

As far as why it worked on Cygwin and not with your current setup, well, frankly that's not what this forum is for. I believe Cygwin states it best: http://www.cygwin.com/

People here are more than willing to help, but in the course of troubleshooting your current issue - it is irrelevant.
.
Back to top
xv920



Joined: 28 Feb 2006
Posts: 7
Location: Sunnyvale, California USA

PostPosted: Thu 02 Mar '06 22:33    Post subject: Reply with quote

If I took a diff between the original conf file and what I'm using right now,
it would dump these five lines.

> LoadModule php5_module "C:/php/php5apache2.dll"
> PHPIniDir "C:/php"
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .phps
>
> Alias /mediafiles "e:/mediafiles/"

That's it. That's all I added really.
The rest of the file remains unchanged.

By the way, what did the "test.html" test reveal?


Look, here I have a bunch of mpg files. I just want a neat way of
viewing them. Imagine you have tons of mpg files, all named like
"0000.mpg" or "0001.mpg". Using Windows Explorer, you could go into
the directory and click any of them and view it, no problem. But you can
never tell what's the content unless you actually start playing it. What if
you wanted to view some specific footage? Start clicking one by one?
How about one single html file that has links to those mpg files with all
these detailed description about the content of each video file? That is
all I want: a little better, more organized way of playing media files than
Windows Explorer. That doesn't have to be a streaming server, I guess?
I just want to play it locally. It would be nice if it could do it over the
network(and why not? Smile, but right now all I want is a local playback
capability. I just want to play it as if I clicked on Windows Explorer.
And I was able to do it until I switched the Apache2 version.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Thu 02 Mar '06 23:54    Post subject: Reply with quote

If that's the only difference then I'm personally stumped.
.
Back to top


Reply to topic   Topic: slow serving a file View previous topic :: View next topic
Post new topic   Forum Index -> Apache