On Thu, Jun 09, 2022 at 08:01:58AM +0000, nico wrote: > Dear Maintainer, > we use an faster sd-card in our embedded system, nothing else. > Now the start from the lighttpd server takes often over an minute. > we use debian 10, for the bug submit i upgrade to bullseye, but the behaviour > is the same. > Without fastcgi/php lighttpd start fast, only some second. > > I can send some error.log from the debian 10 system, if needed, but it seems > to identical > > Sometimes we got the following error: > 2022-06-09 06:26:17: gw_backend.c.238) establishing connection failed: > socket: unix:/run/lighttpd/php.socket-0: Resource temporarily unavailable > 2022-06-09 06:26:17: gw_backend.c.255) backend error; we'll disable for 1secs > and send the request to another backend instead:load: 130 > 2022-06-09 06:26:17: gw_backend.c.262) If this happened on Linux: You have > run out of local ports. Check the manual, section Performance how to handle > this.
This sounds more like an issue with your backend, not with lighttpd. If the load is 130, that is more than the default socket backlog of 128, so it sounds like your backend is overloaded and not responding quickly enough. Try replacing your PHP with something trivial -- e.g. something which returns a simple "Hello World" -- and test if that works better. Try replacing your lighttpd fastcgi config with one which uses PHP-FPM to manage the PHP processes, rather than having lighttpd start the PHP. Configuring PHP-FPM to manage the PHP and tuning the number of PHP instances there is the recommended approach to managing your PHP FastCGI servers independently from lighttpd. Do not forget to tune the number of PHP backends started by PHP-FPM. Depending on the resources available on your embedded system, you may want to reduce the number of connections allowed by lighttpd by setting lighttpd.conf: server.max-connections = 64 or whatever number is appropriate for the max number of clients you expect simultaneously connecting to lighttpd. On a resource constrained embedded system, limiting the number of connections which lighttpd accepts can help you limit the load on your backend.