Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: why so many 206's? |
|
Author |
|
Doug22
Joined: 02 Jun 2013 Posts: 57 Location: Houston TX
|
Posted: Thu 12 Sep '13 21:51 Post subject: why so many 206's? |
|
|
I'm trying to understand my Apache logs, and I keep running across large batches of 206-accesses. That's when someone tries to download a file in small pieces. No biggie. But what I simply don't understand is WHY, in downloading a 1 MB file, most people grab it in one piece -- 200 status code, and you're done, and others need MANY HUNDRED separate GETs to get it. Yes, this happens regularly.
What is someone doing to make their system need to access my 1 MB file in several hundred byte chunks? Is this something they can fix?
I'd appreciate a simple explanation. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 13 Sep '13 11:06 Post subject: |
|
|
There is no need to fix it ( at least I think so).
it is because many ppl use download tools which can open more than one connection to download a single file which makes the download faster.
On the other hand if your server can't handle that amount of connections you can use mod_bandwidth to limit the connections per IP. |
|
Back to top |
|
Doug22
Joined: 02 Jun 2013 Posts: 57 Location: Houston TX
|
Posted: Fri 13 Sep '13 15:31 Post subject: |
|
|
Well, this is less about fixing it and more about just understanding it. What could be the advantage, in downloading a 1MB file, of doing it in two hundred pieces? Is this where the person downloading has told his system to download two hundred files, and it's splitting the job equally?
I'm just trying to envision the situation that is leading to such fractured requests.
When downloads are done in this way, it just bloats my log file. Sometimes ridiculously. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Fri 13 Sep '13 19:37 Post subject: |
|
|
Simplified, think of it this way;
If the file is just on one single server, there is no advantage as it can only come down at the max speed of the one connection, or multiple connections that have to share a max seed limit.
1mbps line / 4 shared connections = ~256kbps each connection = 1mbps download.
If however the file is mirrored across multiple servers over multiple locations with round-robin dns, it can grab a little piece from each server, over different connections and get max speed from each connections.
4 separate 1mbps connections = 4mbps download.
Now, if you want to limit the number of open connections to any one IP address, look into mod_limitipconn. |
|
Back to top |
|
Doug22
Joined: 02 Jun 2013 Posts: 57 Location: Houston TX
|
Posted: Fri 13 Sep '13 20:27 Post subject: |
|
|
Thanks. That helps.
But the file is just on one server, and yet lots of GETs are expended to get it. So your assessment is that those doing it get no advantage by doing it? I thought so. But then, one wonders why they do it anyway. |
|
Back to top |
|
Doug22
Joined: 02 Jun 2013 Posts: 57 Location: Houston TX
|
Posted: Thu 17 Oct '13 18:11 Post subject: |
|
|
OK, I figured it out. Here's the answer.
The reason this was happening (and only for pdf files, it seemed) is that browsers with pdf viewers can download the file in "fast web view" mode. That's where the browser downloads the document a page at a time, so people can start looking at it before it is completely downloaded.
It's convenient for the person doing the downloading, but for large documents it really mucks up the Apache log with oodles of 206 requests. How to prevent it? Easy. Just disable "fact web view" on the pdf documents that are posted. Then the browser won't try to do it. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 17 Oct '13 18:37 Post subject: |
|
|
You could change the mime type to application/octet-stream than the browser will download it by default instead of displaying it in the browser. |
|
Back to top |
|
|
|
|
|
|