Project

General

Profile

Feature #1658

Cookie balancer module

Added by kirakuna over 11 years ago. Updated almost 11 years ago.

Status:
Wontfix
Priority:
Normal
Assignee:
Category:
core
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

I have written module for balancing traffic between some count of fcgi modules. So it's called mod_cookie_balancer. Module is watching what cookie was received and redirect request to corresponding fcgi module. Thus we have separate web-users for each fcgi.

Configuration should be like this:


server.modules = ( 
    "mod_cookie_balancer", 
    "mod_fastcgi" 
)

mimetype.assign = (
    ".html"         =>      "text/html" 
)

server.indexfiles    = ("index.php", "index.html",  "index.htm")
server.event-handler = "linux-sysepoll" 
server.document-root = "/home/kir/hash/docroot" 

debug.log-request-header = "enable" 
debug.log-response-header = "enable" 
debug.log-file-not-found = "enable" 
debug.log-request-handling = "enable" 

server.bind="127.0.0.1" 
server.port=8081

cb.count = 2
cb.prefix = "rpref" 
cb.keyword = "userid" 

fastcgi.debug = 1

fastcgi.server = ( "/rpref0" =>
  (( "host" => "127.0.0.1",
     "port" => 5051
  )),
  "/rpref1" =>
  (( "host" => "127.0.0.1",
     "port" => 5052
  ))
)

Module source attached.

mod_cookie_balancer.c (4.97 KB) mod_cookie_balancer.c kirakuna, 2008-05-07 04:57
mod_cookie_balancer.2.c (5.19 KB) mod_cookie_balancer.2.c v 1.01 admin, 2008-05-15 04:26

History

#1

Updated by stbuehler over 11 years ago

  1. mod_magnet
  2. too many bugs in your code
#2

Updated by admin over 11 years ago

1. Main feature of module is better speen under traffic-pressure than LUA-script.
2. Code was re-worked and improved, many mistakes was removed. Please, check it.

#3

Updated by stbuehler over 11 years ago

  1. Did you try mod_magnet and prove it is the bottleneck? Of course a plain c module will be faster, but it takes much more time to maintain it.
  2. Still too many bugs. That is why you should do it in Lua. (Your cookie decoder is not safe)
  3. A balancer that sends requests by default to one backend? That isn't good.

I really don't think this will ever get upstream, even if you fix 2. and 3. - lighttpd is meant to be light, not to do everything you can think of.

#4

Updated by stbuehler almost 11 years ago

  • Status changed from New to Wontfix
  • Pending changed from Yes to No
  • Patch available set to No

Also available in: Atom