use a soft limit so there's not a whole bunch of deletes on every write
This commit is contained in:
parent
da512ad8c2
commit
83cbf246a8
@ -875,7 +875,9 @@ class Notice extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
$qry .= '('.$id.', '.$this->id.', '.$source.', "'.$this->created.'") ';
|
$qry .= '('.$id.', '.$this->id.', '.$source.', "'.$this->created.'") ';
|
||||||
$cnt++;
|
$cnt++;
|
||||||
|
if (rand() % NOTICE_INBOX_SOFT_LIMIT == 0) {
|
||||||
Notice_inbox::gc($id);
|
Notice_inbox::gc($id);
|
||||||
|
}
|
||||||
if ($cnt >= MAX_BOXCARS) {
|
if ($cnt >= MAX_BOXCARS) {
|
||||||
$inbox = new Notice_inbox();
|
$inbox = new Notice_inbox();
|
||||||
$inbox->query($qry);
|
$inbox->query($qry);
|
||||||
|
@ -27,6 +27,7 @@ define('INBOX_CACHE_WINDOW', 101);
|
|||||||
define('NOTICE_INBOX_GC_BOXCAR', 128);
|
define('NOTICE_INBOX_GC_BOXCAR', 128);
|
||||||
define('NOTICE_INBOX_GC_MAX', 12800);
|
define('NOTICE_INBOX_GC_MAX', 12800);
|
||||||
define('NOTICE_INBOX_LIMIT', 1000);
|
define('NOTICE_INBOX_LIMIT', 1000);
|
||||||
|
define('NOTICE_INBOX_SOFT_LIMIT', 1000);
|
||||||
|
|
||||||
define('NOTICE_INBOX_SOURCE_SUB', 1);
|
define('NOTICE_INBOX_SOURCE_SUB', 1);
|
||||||
define('NOTICE_INBOX_SOURCE_GROUP', 2);
|
define('NOTICE_INBOX_SOURCE_GROUP', 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user