Skip to content

Commit

Permalink
Merge branch 'main' into port-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenmanz authored Jan 17, 2024
2 parents 41a86e3 + 99cd581 commit fabb51f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ in {
APP_URL = lib.mkDefault "http://127.0.0.1:${toString cfg.httpPort}";
CYPRESS_baseUrl = lib.mkDefault "http://127.0.0.1:${toString cfg.httpPort}";

SQL_SET_DEFAULT_SESSION_VARIABLES = lib.mkDefault "0";

APP_SECRET = lib.mkDefault "devsecret";

PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = true;
Expand Down
20 changes: 20 additions & 0 deletions docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,23 @@ As mentioned in the features section, devenv is shipped with Xdebug. You need to
This also works great when having to debug API requests, e.g. in Insomnia.

For the CLI, you can use the integrated debug helper `debug` by simply adding it before your CLI commands, e.g. `debug bin/console`.


# MySQL Configuration

The configuration is based on recommendations from Shopware. You can find the documentation [here](https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#mysql-configuration).
By default, we change the following configurations:

| setting | value | description |
|----------------------|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| group_concat_max_len | 32000 | Shopware highly uses GROUP_CONCAT functions within the Database. This setting ensures, that all queries will run correctly. |
| key_buffer_size | 16777216 | Defines, how many index buffers can be held in memory |
| max_allowed_packet | 134217728 | Defines, how much data can be send within one request before the server blocks it. |
| table_open_cache | 1024 | Shopware uses many tables, This settings allows the server to keep more tables open |
| sql_mode | STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION | the default from MySQL, but without ONLY_FULL_GROUP_BY |


# Environment variables

We're setting some environment variables as default.
As example, we're setting SQL_SET_DEFAULT_SESSION_VARIABLES default to `O`, since we're having the shopware recommended configuration for the database.
3 changes: 2 additions & 1 deletion modules/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ in {
settings = {
mysqld = lib.mkMerge [
(lib.mkIf cfg.enable {
group_concat_max_len = 2048;
group_concat_max_len = 32000;
key_buffer_size = 16777216;
max_allowed_packet = 134217728;
table_open_cache = 1024;
port = cfg.mysqlPort;
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION";
})
(lib.mkIf (cfg.enableMysqlBinLog) {
sync_binlog = 0;
Expand Down

0 comments on commit fabb51f

Please sign in to comment.