1

What is the maximum number of VirtualHosts a single lighttpd instance can handle?

I'd like to confirm some numbers before deploying lighttpd for production.

Here's a similar question for the old apache httpd.

Thanks.

fpemud
  • 111
  • 1
  • Does this answer your question? [How do you do load testing and capacity planning for web sites?](https://serverfault.com/questions/350454/how-do-you-do-load-testing-and-capacity-planning-for-web-sites) – diya Nov 04 '22 at 13:54
  • Is there a minimum amount of vhosts you must be sure are supported? – cachius Nov 04 '22 at 14:08

2 Answers2

1

What is the maximum number of VirtualHosts a single lighttpd instance can handle?

When you're configuration is smart, lighttpd does not impose any upper limit.

You can use mod_simple_vhost and have unlimited VirtualHosts. Adding or Removing VirtualHosts won't require any change in the lighttpd configuration, nor a reload. Simply create a directory and your new VirtualHost becomes active. Delete the directory and the VirtualHost is disabled.


In practice of course there will be limits: in addition to load and traffic that probably depends partly on how you configure each virtual host as well when you're not using mod_simple_vhost. Are you using TLS/SSL certificates, serving only static content or dynamically generated content?

For example, as in the Apache question you linked already mentions (somewhat casually), when you don't use mod_simple_vhost and explicitly configure each VirtualHost and configure them with their own separate error and access log files, you pay quite a performance penalty. For each additional log file a web server needs to maintain additional open file handles and you risk running out of file descriptors much more rapidly, compared to maintaining a single log file (with a format that adds a label/field to identify a particular virtual host).

diya
  • 1,771
  • 3
  • 14
0

What is the maximum number of VirtualHosts a single lighttpd instance can handle?

lighttpd does not have an arbitrary limit, and lighttpd config parsing for each request is generally much faster than comparable Apache config parsing.

That said, for any large number of virtual hosts, Apache and lighttpd both provide some pattern options that are more efficient than brute-force listing of each and every virtual host in the web server config.

lighttpd provides

as well as a do-it-yourself in custom lua scripts with

Again, patterns scale better than brute-forcing listing of each virtual host. For example, TLS wildcard certificates are useful in cases such as where the virtual hosts are all subdomains of a single domain. TLS certs with multiple SANs can be useful in other cases.

gstrauss
  • 276
  • 1
  • 5