-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathConfig.cs
More file actions
51 lines (36 loc) · 1.7 KB
/
Config.cs
File metadata and controls
51 lines (36 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Collections.Generic;
namespace FTServer
{
//Default for 4GB Setting
public class Config
{
public static long mb(long len)
{
return 1024L * 1024L * len;
}
public static readonly long lowReadonlyCache = Config.mb(8);
public static readonly long DSize = 1L;
//only index description, not full text, faster indexing
//if wanting more Pages, dotn't care the content, set it to True
public static bool DescriptionOnly = false;
public static long Index_CacheLength = mb(800L) / DSize;
//this should set bigger than 500MB.
//for DescriptionOnly, it can set bigger, because it might load Only 10% to Memory
public static long SwitchToReadonlyIndexLength = mb(750L * (DescriptionOnly ? 3 : 1)) / DSize;
//Readonly Cache after Switch One Database To Readonly
public static long Readonly_CacheLength = SwitchToReadonlyIndexLength / 23L;
//How Many Readonly Databases Having long Cache
//Set 1000 MB Readonly Index Cache
public static long Readonly_MaxDBCount = mb(1000) / Readonly_CacheLength / DSize;
public static long ShortCacheLength = mb(32L * (DescriptionOnly ? 2 : 1));
//HTML Page Cache, this should set bigger, if having more memory.
public static long ItemConfig_CacheLength = mb(256);
public static int ItemConfig_SwapFileBuffer = (int)mb(20);
//this should less than 1/2 MaxMemory
public static long minCache()
{
return Index_CacheLength + Readonly_CacheLength * Readonly_MaxDBCount + ItemConfig_CacheLength
+ ItemConfig_SwapFileBuffer * 2;
}
}
}