Go Back   Technology Forums > Computer Forums > Linux Forum

Forums discussing various aspects of running a LAMP based platform.


Apache Mod_Proxy or Squid?


Reply
 
LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 09-27-2007, 06:43 AM
Junior Member
 
Join Date: May 2006
Posts: 25
DVDGuy is on a distinguished road
Default Apache Mod_Proxy or Squid?

Hey Shri, I know you had evaluated mod_proxy and squid. Care to share the results? Want to look at a new reverse proxy setup for one of my sites.
Reply With Quote
  #2 (permalink)  
Old 09-27-2007, 08:12 PM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

Currently the main proxies are run using squid in reverse caching proxy mode.

However, have been very impressed with some of the capabilities of Apache 2.2's mod_proxy. Specifically the ability to redirect to servers based on named virtual hosts / directories etc.

I'm compiling Apache with mod_proxy as we speak.

Code:
./configure --enable-proxy --enable-proxy-httpd --enable-proxy-balancer --enable-headers --enable-file-cache --enable-cache --enable-disk-cache --enable-static-htcache-clean --prefix=/usr/local/apache --with-mpm=worker
Reply With Quote
  #3 (permalink)  
Old 09-28-2007, 11:21 PM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

Initial reaction after replacing a year old Squid cache... mod_proxy might not offer the best performance, but it does offer a lot of flexibility.

Also.. do keep in mind that the mod_proxy performance is within a few percentage points of Squid, so not a major issue, specially since it offers us some great flexibility.
Reply With Quote
  #4 (permalink)  
Old 09-30-2007, 06:13 AM
Junior Member
 
Join Date: Sep 2007
Posts: 29
Steve-o is on a distinguished road
Default

Squid 3 as a complete rewrite is supposed to bump up the performance a bit as progress has been limited for a while. I used Squid as a convenient gateway that automagically redirects to a simple static page server when the main server fails.

Perlbal is an alternative if all you are after is a software load balancing solution.
Reply With Quote
  #5 (permalink)  
Old 09-30-2007, 07:03 AM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

Steve-O : Would Squid 3 allow us to build http / url aware redirection and caching?

For a lot of the mirrors we run, we just do this for example...

Quote:
ProxyPassMatch ^(/.*\.xpi)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.png)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.gif)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.zip)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.exe)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.jar)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.tar)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.asc)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.md5)$ http://127.0.0.1:81/$1
ProxyPassMatch ^(/.*\.gz)$ http://127.0.0.1:81/$1
Would Squid be able to direct say static traffic to one server (gif / jpg / css etc) and the rest to the main web server?
Reply With Quote
  #6 (permalink)  
Old 10-01-2007, 05:02 PM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

Ok - Apache mod_proxy + mod_cache (mod_disk_cache) have been running on www.geoexpat.com for about 24 hours now. No problems.. infact a random issue with 403 errors getting cached seems to have been eliminated.

I definitely see us replacing a couple of other squids with mod_proxy - just because of the named virtual host capabilities.
Reply With Quote
  #7 (permalink)  
Old 10-01-2007, 08:24 PM
Junior Member
 
Join Date: Sep 2007
Posts: 29
Steve-o is on a distinguished road
Default

Quote:
Originally Posted by shri View Post
Steve-O : Would Squid 3 allow us to build http / url aware redirection and caching?
Squid 2 does this with external redirectors, you can get them to do anything you want. Commonly found in some Squid A/V modules.

Caching isn't overly productive on forums, hence the Perlbal suggestion. You could expose the static web host externally, it would make things easier.
Reply With Quote
  #8 (permalink)  
Old 10-01-2007, 09:52 PM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

In our case specifically on geoexpat ... we proxy out of HK, so caching css / images / javascript etc locally does make a fair bit of difference in speed for the end user.
Reply With Quote
  #9 (permalink)  
Old 10-05-2007, 02:32 AM
Administrator
 
Join Date: Dec 2006
Posts: 304
shri has disabled reputation
Default

We found several cases where corrupted javascript / css were being delivered.

Long story short ... turns out some headers were getting messed up while transitioning from lighttpd to apache (lighty was forcing a compress on JS / CSS).

So .. if you're using apache -> lighty type proxying ... turn off the mod_deflate in there.
Reply With Quote
Reply





Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache httpd mod_proxy errors ljohnson Linux Forum 2 12-10-2007 04:31 PM
Lighttpd + Apache 2.2 mod_proxy Setup shri Linux Forum 7 10-10-2007 02:13 PM



Advanced Search

All times are GMT -6. The time now is 06:15 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.