in the package from mariadb there is no compression avalible,
it is possible to have compression in mariadb, for this it is required to compile mariadb.

here are the linux commands i have used to compile it and package it into a deb repository.


sudo su -

cd /opt

mkdir mariadb

apt-get install build-essential devscripts dpkg-sig git

apt-get install libsnappy-dev liblzo2-dev libbz2-dev liblzma-dev liblz4-dev # when you have these libs it enables compression automatically
apt-get install bison chrpath cmake debhelper dh-apparmor dpatch libaio-dev libboost-dev libjudy-dev libkrb5-dev libncurses5-dev libpam0g-dev libreadline-gplv2-dev libssl-dev po-debconf psmisc zlib1g-dev libcrack2-dev libjemalloc-dev

git clone --recursive https://github.com/MariaDB/server.git

cd server
git checkout 10.1
./debian/autobake-deb.sh

cd ..

mkdir notsig # optional to have a backup of non signed debs
cp ./*maria* ./notsig/ # optional to have a backup of non signed debs

mkdir repo
cp -r notsig repo/files
cd repo

apt-get install rng-tools # this is required if system says not enough entropy to generate rsa key below.
gpg --gen-key # make rsa only key with 4096 bits without a passphraze
gpg --list-keys #see those numbers that come after 'pub 4096R/' in the list
gpg --output keyFile --armor --export 9D0234BB
dpkg-sig -k 'Full Name (comment) <email@email.com>' --sign builder ./*.deb #waht comes after uid in gpg key list, not sure about this command: why i need to add some name to signing, why even after signing apt told me my debs are not trusted
cat keyFile | apt-key add -


for ubuntu 14

mkdir -p dists/trusty/binary/binary-amd64/Packages
apt-ftparchive packages ./files > dists/trusty/binary/binary-amd64/Packages
gzip -c dists/trusty/binary/binary-amd64/Packages > dists/trusty/binary/binary-amd64/Packages.gz
apt-ftparchive release ./files > dists/trusty/binary/binary-amd64/Release
gpg --clearsign -o InRelease dists/trusty/binary/binary-amd64/Release
gpg -abs -o dists/trusty/binary/binary-amd64/Release.gpg dists/trusty/binary/binary-amd64/Release


or for ubuntu 16:

mkdir -p dists/xenial/binary/binary-amd64
apt-ftparchive packages ./files > dists/xenial/binary/binary-amd64/Packages
gzip -c dists/xenial/binary/binary-amd64/Packages > dists/xenial/binary/binary-amd64/Packages.gz
apt-ftparchive release ./files > dists/xenial/binary/binary-amd64/Release
gpg --clearsign -o InRelease dists/xenial/binary/binary-amd64/Release
gpg -abs -o dists/xenial/binary/binary-amd64/Release.gpg dists/xenial/binary/binary-amd64/Release


for ubuntu 14

add to /etc/apt/sources.list:
deb [arch=amd64 trusted=yes] file:/root/mariadb/repo trusty binary

for ubuntu 16


nano /etc/apt/sources.list.d/mariadb-local.list

add:

deb [arch=amd64 trusted=yes] file:/opt/mariadb/repo xenial binary


then:

 chmod 755 -R /opt/mariadb
apt update

my /etc/mysql/my.cnf
it is a large server with 32g ram and ssd (for temporary processing of large amounts of data).
it is very fast , one problem I have found is that MariaDB/MySQL gives one thread per connection

from MediaWiki settings:

# MySQL table options to use during installation or update
$wgDBTableOptions = “ENGINE=InnoDB, DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED”;

if I use utf8mb4, to have varchar 255 length columns, table type must be ROW_FORMAT=COMPRESSED or ROW_FORMAT=DYNAMIC
otherwise, max length is about 75

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set = utf8mb4

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
##charset https://mathiasbynens.be/notes/mysql-utf8mb4
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_bin
innodb_large_prefix

#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking =1
#skip-name-resolve =1

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
bind-address = 0.0.0.0

#
# * Fine Tuning
#

sysdate-is-now = 1

# MyISAM #
key-buffer-size = 32M

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
# myisam-recover = BACKUP
myisam-recover-options = FORCE,BACKUP

key_buffer_size = 16M
max_allowed_packet = 64M
thread_stack = 192K
thread_cache_size = 8

# SAFETY #
#max-allowed-packet = 16M
#max-connect-errors = 1000000
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10

# CACHES AND LIMITS #
tmp_table_size = 32M
max_heap_table_size = 32M
query_cache_type = 0
query_cache_size = 0
max_connections = 3000
thread_cache_size = 50
open_files_limit = 65535
table_definition_cache = 1024
table_open_cache = 2gb

#https://mariadb.org/significant-performance-boost-with-new-mariadb-page-compression-on-fusionio/
#innodb_use_native_aio = 1
#innodb_use_mtflush =1
innodb_doublewrite = 0
##innodb_use_fallocate = 1
#innodb_use_atomic_writes = 1
#innodb_use_trim = 1
#innodb_buffer_pool_instances = 16
#innodb_mtflush_threads = 16
#innodb_use_lz4=1
innodb_compression_algorithm=lzo #snappy #lz4
innodb_compression_level=9
#innodb_flush_method = O_DIRECT
innodb_thread_concurrency = 0
##REMOVED #innodb_thread_concurrencty = 32
innodb_write_io_threads = 8
innodb_read_io_threads = 8
#innodb_file_format=barracuda
#innodb_lru_scan_depth=2000
#innodb_io_capacity=12000 # 25480/8724
#innodb_io_capacity_max=12000 # https://www.binarylane.com.au/support/solutions/articles/1000055889-how-to-benchmark-disk-i-o

#
# * Query Cache Configuration
#
#query_cache_limit = 1M
#query_cache_size = 16M

#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name

## REPLICATION

#server-id = 1
#report_host = master1
#auto_increment_increment = 2
#auto_increment_offset = 1
#log_bin = /var/log/mysql/mariadb-bin
#log_bin_index = /var/log/mysql/mariadb-bin.index
# not fab for performance, but safer

#server-id = 1
#report_host = master1
#auto_increment_increment = 2
#auto_increment_offset = 1
#log_bin = /var/log/mysql/mariadb-bin
#read_only
#
# If applications support it, this stricter sql_mode prevents some
# mistakes like inserting invalid dates etc.
#sql_mode

transaction-isolation=READ-COMMITTED

# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
innodb_flush_method = O_DIRECT
innodb_log_files_in_group = 2
innodb_log_file_size = 128MB #512MB
innodb_flush_log_at_trx_commit = 2
innodb_file_per_table = 1
innodb_buffer_pool_size = 20GB
innodb_buffer_pool_instances=8
innodb_file_per_table #http://dba.stackexchange.com/questions/8982/what-is-the-best-way-to-reduce-the-size-of-ibdata-in-mysql
innodb_file_format=Barracuda
#innodb_default_row_format=COMPRESSED
sync_binlog=0
innodb_fast_shutdown = 0
# * Security Features
#

# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

#MORE DEFAULT SETTINGS not sure about them read later
##open-files-limit = 2000
#table_open_cache = 400
#myisam_sort_buffer_size = 512M
#concurrent_insert = 2
#read_buffer_size = 2M
#read_rnd_buffer_size = 1M
#
#query_cache_limit = 128K
#query_cache_size = 64M
## for more write intensive setups, set to DEMAND or OFF
##query_cache_type = DEMAND
#
## we do want to know about network errors and such
#log_warnings = 2
#
#
## Enable the slow query log to see queries with especially long duration
##slow_query_log[={0|1}]
#slow_query_log_file = /var/log/mysql/mariadb-slow.log
#long_query_time = 10
#
##log_slow_rate_limit = 1000
#log_slow_verbosity = query_plan
#
##log_slow_admin_statements
#
#
##innodb_log_file_size = 50M
#innodb_buffer_pool_size = 256M
innodb_log_buffer_size = 8M
#innodb_file_per_table = 1
#innodb_open_files = 400
#innodb_io_capacity = 400
#innodb_flush_method = O_DIRECT

innodb-use-mtflush=1
innodb-mtflush-threads=32
innodb-buffer-pool-instances=32

###############END MORE

#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0

[mysqldump]
quick
quote-names
max_allowed_packet = 64M
default-character-set = utf8mb4

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
default-character-set = utf8mb4

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/