1

I have an API that used to run on Apache but now is served via lighttpd. I can easily switch the API URL in the app to the lighty port like api.net:81. I wonder if I should use mod_proxy instead to have cleaner urls. There is no redirect for legacy urls necessary. What would be the overhead for the Apache in between compared to the direct call?

Would mod_proxy and Apache steal the benefit of lightys lightweightness?

Chadddada
  • 1,680
  • 1
  • 19
  • 26
ivoba
  • 113
  • 4
  • I'd suggest getting two IP's instead, then Apache can listen on port 80 on one IP and Lighttpd can have the other, then you wouldn't have to worry about proxying. Then you can set up something like 'new.api.net' to go to the lighttpd IP and 'api.net' to go to the apache one. I don't know your infrastructure so I'm not sure how easy that will be but just my suggestions, YMMV –  Jun 20 '11 at 11:40

1 Answers1

1

It's safe to say mod_proxy will be an overhead, because you're routing the queries through two pieces of software instead of one. Unless mod_proxy is providing some caching (and hence a performance benefit) then it will reduce performance.

How much isn't something anyone can answer easily - you would need to profile it yourself.

Configure it without mod_proxy (i.e. direct to lighttpd) and run a selection of tests and measure the performance. Then, configure it so it goes via mod_proxy in Apache and perform the same tests. Measure the difference and decide if you want to pay for the better looking URL's with the performance hit you measured.

Don't forget you'll need to factor in request speed and concurrency, if you can, in your tests.

So in summary, yes, it's likely there'll be an overhead but you'll need to profile it yourself to measure it.

EightBitTony
  • 9,311
  • 1
  • 34
  • 46