Project

General

Profile

Actions

Feature #1658

closed

Cookie balancer module

Added by kirakuna almost 16 years ago. Updated over 15 years ago.

Status:
Wontfix
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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.


Files

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
Actions #1

Updated by stbuehler almost 16 years ago

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

Updated by admin almost 16 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.

Actions #3

Updated by stbuehler almost 16 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.

Actions #4

Updated by stbuehler over 15 years ago

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

Also available in: Atom