mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=11838
This commit is contained in:
parent
ed1d97c01b
commit
375ba7fdaa
|
@ -442,7 +442,16 @@ David 11 Jan 2007
|
|||
Sometimes the cache gets so full that it takes 30 secs
|
||||
just to compute free and used disk space,
|
||||
so that normal cleanup times out before it does anything.
|
||||
I recommend running clean_cache.php once a day.
|
||||
|
||||
html/ops/
|
||||
clean_cache.php (new)
|
||||
|
||||
David 11 Jan 2007
|
||||
- user web: call set_time_limit(0) in cache_check_diskspace().
|
||||
This will hopefully avoid the situation described above.
|
||||
|
||||
html/
|
||||
inc/
|
||||
cache.inc
|
||||
project.sample/
|
||||
cache_parameters.inc
|
||||
|
|
|
@ -140,7 +140,7 @@ Web site
|
|||
<li> <a href=translation.php>Web site translation</a>
|
||||
<li> <a href=sstatus.php>Server status page</a>
|
||||
<li> <a href=profile_screen.php>Profile screening</a>
|
||||
<li> <a href=web_cache.php>Caching and translation</a>
|
||||
<li> <a href=web_cache.php>Caching</a>
|
||||
</ul>
|
||||
<font size=+1><b>
|
||||
Miscellaneous
|
||||
|
|
|
@ -1,8 +1,34 @@
|
|||
<?php
|
||||
require_once("docutil.php");
|
||||
|
||||
page_head("Caching and translation");
|
||||
page_head("Web page caching");
|
||||
echo "
|
||||
Some pages on your project's web site are
|
||||
accessed often and require lots of database access to generate.
|
||||
To keep this from bogging down your server,
|
||||
BOINC caches these pages.
|
||||
This cache is in PROJECT/html/cache/*;
|
||||
a one-level hashed directory hierarchy is used
|
||||
to deal with large-directory performance problems.
|
||||
|
||||
<h2>Caching configuration</h2>
|
||||
<p>
|
||||
The file html/project/cache_parameters.inc
|
||||
contains a number of parameters related to caching:
|
||||
";
|
||||
list_start();
|
||||
list_item("TEAM_PAGE_TTL", "Cache life of team pages; default 1 hour");
|
||||
list_item("USER_PAGE_TTL", "Cache life of user pages; default 1 hour");
|
||||
list_item("USER_HOST_TTL", "Cache life of user host list; default 1 hour");
|
||||
list_item("USER_PROFILE_TTL", "Cache life of profiles; default 1 hour");
|
||||
list_item("TOP_PAGES_TTL", "Cache life of user/team/host lists; default 12 hours");
|
||||
list_item("INDEX_PAGE_TTL", "Cache life of main page; default 1 hour");
|
||||
list_item("MAX_CACHE_USAGE", "Max cache size; default 100 MB");
|
||||
list_item("MIN_FREE_SPACE", "Min free space on device; default 100 MB");
|
||||
list_item("CACHE_SIZE_CHECK_FREQ", "Check cache size on every N user accesses to cached pages; default 1000");
|
||||
list_end();
|
||||
echo "
|
||||
<h2>Caching and translation</h2>
|
||||
BOINC uses several web-page caching systems,
|
||||
which support language translation in different ways.
|
||||
|
||||
|
|
|
@ -84,12 +84,13 @@ function clean_cache($max_age, $dir) {
|
|||
// check free disk space every once in a while
|
||||
function cache_check_diskspace(){
|
||||
if (!(rand() % CACHE_SIZE_CHECK_FREQ)) {
|
||||
$too_old=86400;
|
||||
set_time_limit(0); // this may take a while
|
||||
$max_age = 86400;
|
||||
while ((disk_free_space("../cache") < MIN_FREE_SPACE) ||
|
||||
(disk_usage("../cache") > MAX_CACHE_USAGE)
|
||||
) {
|
||||
clean_cache($too_old, "../cache");
|
||||
$too_old/=2;
|
||||
clean_cache($max_age, "../cache");
|
||||
$max_age/=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,20 +2,19 @@
|
|||
|
||||
// Define the lifetime of public php pages.
|
||||
// define to zero to turn of caching for these pages.
|
||||
define('TEAM_PAGE_TTL',3600);
|
||||
define('USER_PAGE_TTL',3600);
|
||||
define('USER_HOST_TTL',3600);
|
||||
define('USER_PROFILE_TTL',3600);
|
||||
define('TOP_PAGES_TTL',43200);
|
||||
define('DOWNLOAD_PAGE_TTL',3600);
|
||||
define('INDEX_PAGE_TTL',3600);
|
||||
define('TEAM_PAGE_TTL', 3600);
|
||||
define('USER_PAGE_TTL', 3600);
|
||||
define('USER_HOST_TTL', 3600);
|
||||
define('USER_PROFILE_TTL', 3600);
|
||||
define('TOP_PAGES_TTL', 43200);
|
||||
define('INDEX_PAGE_TTL', 3600);
|
||||
|
||||
// Define the max allowed cache usage and the min allowed free space
|
||||
// Both default to 100M.
|
||||
define('MAX_CACHE_USAGE',104857600);
|
||||
define('MIN_FREE_SPACE',104857600);
|
||||
define('MAX_CACHE_USAGE', 104857600);
|
||||
define('MIN_FREE_SPACE', 104857600);
|
||||
|
||||
// Number of page views between cache size checks
|
||||
define('CACHE_SIZE_CHECK_FREQ',1000);
|
||||
define('CACHE_SIZE_CHECK_FREQ', 1000);
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue