]> Lady’s Gitweb - Gitweb/commit
gitweb: Load checking
authorJohn 'Warthog9' Hawley <redacted>
Sat, 30 Jan 2010 22:30:39 +0000 (23:30 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:39 +0000 (00:50 -0400)
commitd2cbbf810674b5255fd8382381a83a2d990379d1a0524e0b0c41439d51aaeb99
tree9bbfc6696f3ef867c7e20c4bc0ddc2fbb5b692211f8209bbb8fff1896f555687
parentdfed1712bf5d73e66eea825f154c614f4f74f6d463f90dc1dab90447d1901328
gitweb: Load checking

This changes slightly the behavior of gitweb, so that it verifies
that the box isn't inundated with before attempting to serve gitweb.
If the box is overloaded, it basically returns a 503 Server Unavailable
until the load falls below the defined threshold.  This helps dramatically
if you have a box that's I/O bound, reaches a certain load and you
don't want gitweb, the I/O hog that it is, increasing the pain the
server is already undergoing.

This behavior is controlled by $maxload configuration variable.
Default is a load of 300, which for most cases should never be hit.
Unset it (set it to undefined value, i.e. undef) to turn off checking.

Currently it requires that '/proc/loadavg' file exists, otherwise the
load check is bypassed (load is taken to be 0).  So platforms that do
not implement '/proc/loadavg' currently cannot use this feature
(provisions are included for additional checks to be added by others).

There is simple test in t/t9501-gitweb-standalone-http-status.sh to
check that it correctly returns "503 Service Unavailable" if load is
too high, and also if there are any Perl warnings or errors.

Signed-off-by: John 'Warthog9' Hawley <redacted>
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
README
gitweb.perl
This page took 0.249799 seconds and 4 git commands to generate.