aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinalone <60921914+inalone@users.noreply.github.com>2022-11-13 01:04:45 +0000
committerGitHub <noreply@github.com>2022-11-13 01:04:45 +0000
commit5a26bb4939251468d704c13de4bfa638fa403754 (patch)
treeac03b7c55cffb75d4e1a413b98ebff41367e88ae
parenta17d6a9210a0714d91f9f5ccb108886053889137 (diff)
parent78773f10540fe74f28b1161a2621a3a36af76046 (diff)
downloadslskd-5a26bb4939251468d704c13de4bfa638fa403754.tar.gz
Merge branch 'master' into download-folder-modal
-rw-r--r--config/slskd.example.yml3
-rw-r--r--docs/config.md2
-rw-r--r--docs/system_requirements.md37
-rw-r--r--src/slskd/Core/Options.cs27
-rw-r--r--src/slskd/Program.cs12
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs2
-rw-r--r--src/slskd/Transfers/Uploads/UploadService.cs2
7 files changed, 70 insertions, 15 deletions
diff --git a/config/slskd.example.yml b/config/slskd.example.yml
index 39b52aad..2cddd8e6 100644
--- a/config/slskd.example.yml
+++ b/config/slskd.example.yml
@@ -1,5 +1,4 @@
# debug: false
-# experimental: false
# remote_configuration: false
# instance_name: default
# flags:
@@ -10,6 +9,8 @@
# force_share_scan: false
# no_version_check: false
# log_sql: false
+# experimental: false
+# volatile: false
# network:
# mode: controller # controller (default), agent, or debug (for local development)
# # controller config is required when running in 'agent' mode
diff --git a/docs/config.md b/docs/config.md
index 1b42c186..bde38889 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -799,7 +799,7 @@ Several additional feature flags are provided to change the application's runtim
| `--force-share-scan` | `SLSKD_FORCE_SHARE_SCAN` | Force a scan of shared directories on startup |
| `--no-version-check` | `SLSKD_NO_VERSION_CHECK` | Don't perform a version check on startup |
| `--log-sql` | `SLSKD_LOG_SQL` | Log SQL queries generated by Entity Framework |
-| `--dual-network-mode`| `SLSKD_DUAL_NETWORK_MODE` | Run in both Agent and Controller network modes |
+| `--volatile` | `SLSKD_VOLATILE` | Use volatile data storage (all data will be lost at shutdown) |
#### **YAML**
```yaml
diff --git a/docs/system_requirements.md b/docs/system_requirements.md
new file mode 100644
index 00000000..87241fab
--- /dev/null
+++ b/docs/system_requirements.md
@@ -0,0 +1,37 @@
+# System Requirements
+
+Designed to run on a minimum of a Raspberry Pi 2 (or equivalent), or any system with:
+
+* x86, x86_64, amd64, or ARMv7+ processor
+* at least 512mb RAM
+* at least 150mb disk space
+
+Users concerned about optimal performance should consider something faster.
+
+# Known Issues
+
+## Any device with an ARMv6 or earlier processor
+
+Not supported by the .NET runtime. This may change in future versions.
+
+## Raspberry Pi Zero (any variant)
+
+At the moment all Pi Zeros are ARMv6.
+
+## Devices using a copy-on-write filesystem such as BTRFS or ZFS
+
+slskd uses SQLite to store transactional data associated with things like transfers and searches, and these reads and writes experience too much I/O latency for the application to work properly with these filesystems.
+
+Optimizations to the filesystems can be made to improve performance, but will come at a cost to most other use cases and are not recommended.
+
+slskd can still run on devices using these filesystems if application data can be stored on a separate disk or partition using a different filesystem, or potentially on a RAM disk (which would be volatile unless configured otherwise).
+
+Users can also enable 'volatile mode' (`SLSKD_VOLATILE` or `flags.volatile: true`), which will use in-memory SQLite tables. Searches and transfers will be lost when the application is restarted while in this mode.
+
+## Application data stored on network filesystems (NFS, SMB, Windows file sharing)
+
+For the same reasons as copy-on-write systems.
+
+## AWS EC2 t3a.nano with Ubuntu Linux
+
+The instance will run out of memory and crash every 12 hours or so. This instance size works when using Amazon Linux OS, but memory usage is very high and wouldn't be able to handle a lot of activity. \ No newline at end of file
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index e273229f..a64d5875 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -151,15 +151,6 @@ namespace slskd
public bool Debug { get; init; } = Debugger.IsAttached;
/// <summary>
- /// Gets a value indicating whether the application should run in experimental mode.
- /// </summary>
- [Argument(default, "experimental")]
- [EnvironmentVariable("EXPERIMENTAL")]
- [Description("run in experimental mode")]
- [RequiresRestart]
- public bool Experimental { get; init; } = false;
-
- /// <summary>
/// Gets a value indicating whether remote configuration of options is allowed.
/// </summary>
[Argument(default, "remote-configuration")]
@@ -372,6 +363,24 @@ namespace slskd
[Description("log SQL queries generated by Entity Framework")]
[RequiresRestart]
public bool LogSQL { get; init; } = false;
+
+ /// <summary>
+ /// Gets a value indicating whether the application should run in experimental mode.
+ /// </summary>
+ [Argument(default, "experimental")]
+ [EnvironmentVariable("EXPERIMENTAL")]
+ [Description("run in experimental mode")]
+ [RequiresRestart]
+ public bool Experimental { get; init; } = false;
+
+ /// <summary>
+ /// Gets a value indicating whether the application should run in volatile mode.
+ /// </summary>
+ [Argument(default, "volatile")]
+ [EnvironmentVariable("VOLATILE")]
+ [Description("use volatile data storage (all data will be lost at shutdown)")]
+ [RequiresRestart]
+ public bool Volatile { get; init; } = false;
}
/// <summary>
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 3a4e923f..72288853 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -517,8 +517,16 @@ namespace slskd
services.AddSingleton<IConnectionWatchdog, ConnectionWatchdog>();
- services.AddDbContext<SearchDbContext>($"Data Source={Path.Combine(DataDirectory, "search.db")};Cache=shared;Pooling=True;");
- services.AddDbContext<TransfersDbContext>($"Data Source={Path.Combine(DataDirectory, "transfers.db")};Cache=shared;Pooling=True;");
+ if (OptionsAtStartup.Flags.Volatile)
+ {
+ services.AddDbContext<SearchDbContext>($"Data Source=file:search?mode=memory;Cache=shared;Pooling=True;");
+ services.AddDbContext<TransfersDbContext>($"Data Source=file:transfers?mode=memory;Cache=shared;Pooling=True;");
+ }
+ else
+ {
+ services.AddDbContext<SearchDbContext>($"Data Source={Path.Combine(DataDirectory, "search.db")};Cache=shared;Pooling=True;");
+ services.AddDbContext<TransfersDbContext>($"Data Source={Path.Combine(DataDirectory, "transfers.db")};Cache=shared;Pooling=True;");
+ }
services.AddSingleton<IBrowseTracker, BrowseTracker>();
services.AddSingleton<IConversationTracker, ConversationTracker>();
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs
index 1d1b6dfc..4c3a7298 100644
--- a/src/slskd/Transfers/Downloads/DownloadService.cs
+++ b/src/slskd/Transfers/Downloads/DownloadService.cs
@@ -446,7 +446,7 @@ namespace slskd.Transfers.Downloads
/// <param name="transfer">The transfer to update.</param>
public void Update(Transfer transfer)
{
- var experimental = OptionsMonitor.CurrentValue.Experimental;
+ var experimental = OptionsMonitor.CurrentValue.Flags.Experimental;
var id = Guid.NewGuid();
System.Diagnostics.Stopwatch sw = default;
diff --git a/src/slskd/Transfers/Uploads/UploadService.cs b/src/slskd/Transfers/Uploads/UploadService.cs
index 77d91525..3a2dbedf 100644
--- a/src/slskd/Transfers/Uploads/UploadService.cs
+++ b/src/slskd/Transfers/Uploads/UploadService.cs
@@ -429,7 +429,7 @@ namespace slskd.Transfers.Uploads
/// <param name="transfer">The transfer to update.</param>
public void Update(Transfer transfer)
{
- var experimental = OptionsMonitor.CurrentValue.Experimental;
+ var experimental = OptionsMonitor.CurrentValue.Flags.Experimental;
var id = Guid.NewGuid();
System.Diagnostics.Stopwatch sw = default;