Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When a request is denied due to excessive load average, send a 503 reply code. Also: Enhance the request denied message to show the current load average and the load average limit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d0fa1578402362b61acd449a9d077544c8dc3d54
User & Date: drh 2014-03-09 16:25:28
Context
2014-03-09
22:33
If getloadavg() fails, return 0.0 as function result in stead of a random number check-in: 1707129a user: jan.nijtmans tags: trunk
16:25
When a request is denied due to excessive load average, send a 503 reply code. Also: Enhance the request denied message to show the current load average and the load average limit. check-in: d0fa1578 user: drh tags: trunk
00:19
Show the repository name on the test_env webpage. check-in: 117a0f69 user: drh tags: trunk
Changes

Changes to src/loadctrl.c.

52
53
54
55
56
57
58
59
60


61

62
63
64
** is too high.
*/
void load_control(void){
  double mxLoad = atof(db_get("max-loadavg", "0"));
  if( mxLoad<=0.0 || mxLoad>=load_average() ) return;

  style_header("Server Overload");
  @ <p>The server load is currently too high.
  @ Please try again later.</p>


  style_footer();

  cgi_reply();
  exit(0);
}







|
|
>
>

>



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
** is too high.
*/
void load_control(void){
  double mxLoad = atof(db_get("max-loadavg", "0"));
  if( mxLoad<=0.0 || mxLoad>=load_average() ) return;

  style_header("Server Overload");
  @ <h2>The server load is currently too high.
  @ Please try again later.</h2>
  @ <p>Current load average: %f(load_average()).<br />
  @ Load average limit: %f(mxLoad)</p>
  style_footer();
  cgi_set_status(503,"Server Overload");
  cgi_reply();
  exit(0);
}