You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 Add more tuts more to come 🆙
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
### Understanding the Basics
|
||||
|
||||
The standard MySQL settings are often not optimized for a server with 24 GB of RAM. By adjusting a few key values, you can significantly improve your database's performance. The most important settings to optimize are memory-related, as your server has plenty of it. A buffer that is too small can cripple performance, while one that is too large can lead to excessive use of swap space.
|
||||
|
||||
You'll need to open your MySQL configuration file, which is typically named `my.cnf`. Common locations include:
|
||||
|
||||
* `/etc/mysql/my.cnf`
|
||||
* `/etc/my.cnf`
|
||||
* `/etc/mysql/mysql.conf.d/mysqld.cnf`
|
||||
|
||||
Always make a backup of the original file before making any changes.
|
||||
|
||||
```bash
|
||||
sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
|
||||
sudo nano /etc/mysql/my.cnf
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Key Settings for 24 GB RAM
|
||||
|
||||
Add or adjust the following lines under the `[mysqld]` section of the configuration file. These settings are optimized for a **dedicated database server** with 24 GB of RAM. If you also use the server for other purposes, you may want to lower the values.
|
||||
|
||||
#### 1\. InnoDB Buffer Pool Size
|
||||
|
||||
This is the single most important setting. The **InnoDB buffer pool** is the cache for your database. A larger buffer pool means MySQL can keep more of your data in fast RAM, reducing the need to read from the disk.
|
||||
|
||||
A good rule of thumb is to allocate 70-80% of your total RAM. For a 24 GB server, a value between 16 and 19 GB is excellent.
|
||||
|
||||
```ini
|
||||
innodb_buffer_pool_size = 16G
|
||||
```
|
||||
|
||||
#### 2\. Query Cache
|
||||
|
||||
The `query_cache` stores the results of previously executed queries. While this can be useful for sites with many identical, repeated queries, it often becomes a performance bottleneck on busy servers. The query cache was deprecated in MySQL 5.7.20 and completely removed in MySQL 8.0. **It's best practice to disable it.**
|
||||
|
||||
```ini
|
||||
query_cache_type = 0
|
||||
query_cache_size = 0
|
||||
```
|
||||
|
||||
#### 3\. Thread Cache Size
|
||||
|
||||
The `thread_cache_size` determines how many threads MySQL keeps in a cache for reuse. This prevents the overhead of constantly creating new threads. A higher value is beneficial for a busy server.
|
||||
|
||||
```ini
|
||||
thread_cache_size = 128
|
||||
```
|
||||
|
||||
#### 4\. Max Connections
|
||||
|
||||
Set `max_connections` to a value that suits the expected number of concurrent users. The default of 151 is often too low for a busy website.
|
||||
|
||||
```ini
|
||||
max_connections = 500
|
||||
```
|
||||
|
||||
#### 5\. MyISAM Key Buffer Size
|
||||
|
||||
If you're still using MyISAM tables, you should set the `key_buffer_size`. If you're exclusively using InnoDB (which is the default and recommended), this value is not as important.
|
||||
|
||||
```ini
|
||||
key_buffer_size = 128M
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Complete `my.cnf` Example
|
||||
|
||||
Here is a summary of the recommended settings. You can copy and paste this into your `my.cnf` file under the `[mysqld]` section.
|
||||
|
||||
```ini
|
||||
[mysqld]
|
||||
# Basic settings
|
||||
user = mysql
|
||||
pid-file = /var/run/mysqld/mysqld.pid
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
port = 3306
|
||||
|
||||
# Memory & InnoDB settings
|
||||
innodb_buffer_pool_size = 16G
|
||||
innodb_log_file_size = 256M
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_file_per_table = 1
|
||||
innodb_flush_method = O_DIRECT
|
||||
|
||||
# Concurrency & Performance
|
||||
max_connections = 500
|
||||
thread_cache_size = 128
|
||||
|
||||
# Query Cache (recommended to disable)
|
||||
query_cache_type = 0
|
||||
query_cache_size = 0
|
||||
|
||||
# MyISAM (if applicable)
|
||||
key_buffer_size = 128M
|
||||
|
||||
# Logging
|
||||
log_error = /var/log/mysql/error.log
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Applying the Changes
|
||||
|
||||
After saving your changes, you must restart the MySQL service to apply the new settings.
|
||||
|
||||
```bash
|
||||
sudo systemctl restart mysql
|
||||
```
|
||||
|
||||
You can then check the status of the service to ensure it started successfully.
|
||||
|
||||
```bash
|
||||
sudo systemctl status mysql
|
||||
```
|
||||
|
||||
By applying these settings, your database will make much more efficient use of the 24 GB of RAM, resulting in significantly better responsiveness and throughput for your application.
|
||||
@@ -0,0 +1,109 @@
|
||||
### Understanding the Basics
|
||||
|
||||
With a 32 GB RAM server, your primary goal is to maximize the use of available memory to reduce disk I/O, which is the slowest part of database operations. The main setting to focus on is the size of the InnoDB buffer pool.
|
||||
|
||||
Open your MySQL configuration file, which is typically `my.cnf`. Common locations include:
|
||||
|
||||
* `/etc/mysql/my.cnf`
|
||||
* `/etc/my.cnf`
|
||||
* `/etc/mysql/mysql.conf.d/mysqld.cnf`
|
||||
|
||||
Always make a backup of the original file before making any changes.
|
||||
|
||||
```bash
|
||||
sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
|
||||
sudo nano /etc/mysql/my.cnf
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Key Settings for 32 GB RAM
|
||||
|
||||
Add or adjust the following lines under the `[mysqld]` section of the configuration file. These settings are optimized for a **dedicated database server**. If your server hosts other resource-intensive applications, you should slightly decrease these values.
|
||||
|
||||
#### 1\. InnoDB Buffer Pool Size
|
||||
|
||||
The **InnoDB buffer pool** is the most critical setting. It's the cache for your data and indexes. A larger buffer pool means MySQL can keep more of your active dataset in fast RAM, drastically improving performance.
|
||||
|
||||
For a 32 GB server, allocating about 70-80% of the total RAM is ideal. This leaves enough memory for the operating system and other processes.
|
||||
|
||||
```ini
|
||||
innodb_buffer_pool_size = 24G
|
||||
```
|
||||
|
||||
#### 2\. Query Cache
|
||||
|
||||
The query cache is known to cause performance issues on busy servers, and it has been removed in MySQL 8.0. **It's best to disable it** on modern systems.
|
||||
|
||||
```ini
|
||||
query_cache_type = 0
|
||||
query_cache_size = 0
|
||||
```
|
||||
|
||||
#### 3\. Thread Cache Size
|
||||
|
||||
The **thread cache** stores threads for reuse, which avoids the overhead of creating new threads for each connection. A higher value is beneficial for a server with many concurrent connections.
|
||||
|
||||
```ini
|
||||
thread_cache_size = 256
|
||||
```
|
||||
|
||||
#### 4\. Max Connections
|
||||
|
||||
Set `max_connections` to a value that reflects the expected number of concurrent users or application connections. A value of 500 is a good starting point for a busy server.
|
||||
|
||||
```ini
|
||||
max_connections = 500
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Complete `my.cnf` Example
|
||||
|
||||
Here is a summary of the recommended settings. Copy and paste these into your `my.cnf` file under the `[mysqld]` section.
|
||||
|
||||
```ini
|
||||
[mysqld]
|
||||
# Basic settings
|
||||
user = mysql
|
||||
pid-file = /var/run/mysqld/mysqld.pid
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
port = 3306
|
||||
|
||||
# Memory & InnoDB settings
|
||||
innodb_buffer_pool_size = 24G
|
||||
innodb_log_file_size = 256M
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_file_per_table = 1
|
||||
innodb_flush_method = O_DIRECT
|
||||
|
||||
# Concurrency & Performance
|
||||
max_connections = 500
|
||||
thread_cache_size = 256
|
||||
|
||||
# Query Cache (recommended to disable)
|
||||
query_cache_type = 0
|
||||
query_cache_size = 0
|
||||
|
||||
# MyISAM (if applicable)
|
||||
key_buffer_size = 128M
|
||||
|
||||
# Logging
|
||||
log_error = /var/log/mysql/error.log
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Applying the Changes
|
||||
|
||||
After saving your changes, you must restart the MySQL service to apply the new settings.
|
||||
|
||||
```bash
|
||||
sudo systemctl restart mysql
|
||||
```
|
||||
|
||||
You can then check the status of the service to ensure it started successfully.
|
||||
|
||||
```bash
|
||||
sudo systemctl status mysql
|
||||
```
|
||||
@@ -0,0 +1,116 @@
|
||||
### Tutorial on How to Run AzuraCast on Docker
|
||||
|
||||
This guide will walk you through the process of installing and setting up AzuraCast, a complete web-based radio management solution, using Docker. Using Docker is the recommended method as it bundles all the necessary services (like NGINX, PHP, MySQL, and the streaming software) into isolated containers.
|
||||
|
||||
-----
|
||||
|
||||
### Step 1: Install Docker and Docker Compose
|
||||
|
||||
Before you can run AzuraCast, you need to ensure that Docker and Docker Compose are installed on your server. If you are using a Linux system, run the following commands.
|
||||
|
||||
1. **Install Docker:**
|
||||
Follow the official Docker documentation for your operating system. For Ubuntu, you can use these commands:
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl gnupg lsb-release
|
||||
sudo mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||
```
|
||||
|
||||
Add your user to the `docker` group to avoid using `sudo` every time:
|
||||
|
||||
```bash
|
||||
sudo usermod -aG docker $USER
|
||||
# Log out and back in or run 'newgrp docker' for the change to take effect
|
||||
```
|
||||
|
||||
2. **Install Docker Compose:**
|
||||
Docker Compose is now a plugin for Docker and is installed with the command above.
|
||||
|
||||
-----
|
||||
|
||||
### Step 2: Install AzuraCast
|
||||
|
||||
Now that you have the necessary tools, you can set up AzuraCast.
|
||||
|
||||
1. **Create a Directory for AzuraCast:**
|
||||
Make a dedicated folder for the AzuraCast files. This is where the Docker configuration files and persistent data will be stored.
|
||||
|
||||
```bash
|
||||
mkdir azuracast
|
||||
cd azuracast
|
||||
```
|
||||
|
||||
2. **Download the Docker Installation Script:**
|
||||
AzuraCast provides a convenient installation script that downloads the necessary Docker Compose files and other configuration files.
|
||||
|
||||
```bash
|
||||
curl -L https://azuracast.com/install.sh | bash
|
||||
```
|
||||
|
||||
This script will download and place the `docker-compose.yml` and other relevant files into your current directory.
|
||||
|
||||
3. **Configure the .env File (Optional but Recommended):**
|
||||
The installation script creates a `.env` file. You can edit this file to change important settings, such as ports and domain names.
|
||||
|
||||
```bash
|
||||
nano docker-compose.yml
|
||||
```
|
||||
|
||||
Look for the port settings. By default, this is port `80` and `443` for the web interface. If your server is already using these ports, you can change them here.
|
||||
Change `"80:80"` to `"8080:80"` (this will make the web interface accessible via port 8080).
|
||||
|
||||
4. **Start AzuraCast with Docker Compose:**
|
||||
Run the following command to build and start all the necessary containers. This may take some time depending on your internet connection and server speed.
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
- `up`: Builds and starts the containers.
|
||||
- `-d`: Runs the containers in the background (detached mode).
|
||||
|
||||
-----
|
||||
|
||||
### Step 3: First-Time Setup
|
||||
|
||||
1. **Open the Web Interface:**
|
||||
Open your browser and navigate to your server's IP address (or domain name). If you changed the port, add it to the address, for example: `http://your-server-ip:8080`.
|
||||
|
||||
2. **Complete the Setup Wizard:**
|
||||
The AzuraCast setup page will appear. Follow the steps to create an administrator account. You can also set up your first radio station here. The wizard automatically configures the database and streaming software.
|
||||
|
||||
-----
|
||||
|
||||
### Step 4: Managing Your Radio Station
|
||||
|
||||
Congratulations\! You now have a working AzuraCast installation. You can manage your radio station through the web interface.
|
||||
|
||||
* **Dashboards:** View listener statistics, the current playlist, and the status of your streaming services.
|
||||
* **Upload Files:** Go to the "Media" section to upload audio files to your radio station.
|
||||
* **Playlists and Automation:** Set up playlists and schedule when you want to play tracks, or use the "AutoDJ" to mix the music automatically.
|
||||
|
||||
#### Useful Docker Commands:
|
||||
|
||||
* **Check container status:**
|
||||
```bash
|
||||
docker-compose ps
|
||||
```
|
||||
* **View logs (useful for debugging):**
|
||||
```bash
|
||||
docker-compose logs -f
|
||||
```
|
||||
* **Stop the containers:**
|
||||
```bash
|
||||
docker-compose stop
|
||||
```
|
||||
* **Completely remove the containers (including data):**
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
By following these steps, you will have a robust and easy-to-manage AzuraCast installation ready to host your radio station.
|
||||
Reference in New Issue
Block a user