Welcome to WebmasterWorld Guest from 54.158.143.40

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Load balance low. Apache connections HIGH

This is due to images being hotlinked... killing my server.

   
7:48 pm on May 18, 2006 (gmt 0)

10+ Year Member



So I run a site that receives a high volume of traffic, but on my Dual Xeon the server load is always nice and low. The problem is, there are a LOT of users who use my service to create profile backgrounds or layouts for their MySpace profiles. All these profiles are adding up, causing Apache to have over 1000 open connections at a time.

So the issue isn't server load, but the amount of open Apache connections.

What do you think my best option for this is? I tried installing mod_throttle but not too much luck there (still new to apache configurations). This could be the same issue an image hosting type site will see. The users who are pinging the server from other locations are killing the site for users actually trying to get there, many times even impossible to reach.

Has anyone worked with this issue or know a good resolution? Is there a way to allocate X amount of Apache connections for outside usage, so the people trying to access the site will always be able to connect. I don't mind user having to wait a little longer for their hosted images to load, but I do mind having my users on the site have to wait.

Any help would be a TREMENDIOUS help!

Thanks,

Jason

2:11 am on May 19, 2006 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Why not block hotlinking [google.com], serve a very small 403-Forbidden custom error page (0 bytes), and then close those unwanted connections immediately?

Jim

5:58 pm on May 19, 2006 (gmt 0)

10+ Year Member



The whole point of the site is so they can have those images...
6:05 pm on May 19, 2006 (gmt 0)

10+ Year Member



You should consider separating your image/file hosting onto its own server. A dedicated file server whose sole job it is to display images will take the load off your application servers. Further, you will find you can serve a lot of image traffic from a relatively low powered server.
6:24 pm on May 19, 2006 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



> Is there a way to allocate X amount of Apache connections for outside usage, so the people trying to access the site will always be able to connect.

As far as Apache is concerned, *all* usage is "outside usage." There is no way to determine an image loaded by a client due to being included on one of your own pages from one being loaded by client loading an outside page, except for the (unreliable) HTTP_REFERER request header. It's unreliable because many users, user-agents, and caching proxies block the HTTP referrer header. I also don't know if you can throttle based on that header.

If you want to provide images without greatly impacting your own site, consider hosting the images on a "fat-pipe" distributed hosting service such as akamai, or setting up a separate image server.

Jim