Updated, thanks. Now it reads:

    # "max-connections == max-fds/2",
    # http://redmine.lighttpd.net/projects/1/wiki/Server_max-connectionsDetails
    s.sub!(/^server\.max-connections = .+$/,'server.max-connections = ' + (MAX_FDS / 2).to_s())