[Maria-discuss] MariaDB Compile Size
Hello, Has anyone got any idea how to reduce the MariaDB install size, when compiling from source? I've had multiple attempts, all with different options such as 'WITHOUT_EXAMPLE_STORAGE_ENGINE=1' and 'FEATURE_SET:STRING=large', for example, but with no effect. The installation size is usually around 2.1 GB, whereas the official Arch package, which also compiles from source, is about 231.78 MB. The official Arch build script is here [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packag...], and the only difference I can notice is that they delete a lot of stuff afterwards. Is there any reference for stuff that can be deleted after MariaDB has been installed? Thanks.
Am 19.05.2018 um 07:33 schrieb Tom Jay:
Hello,
Has anyone got any idea how to reduce the MariaDB install size, when compiling from source? I've had multiple attempts, all with different options such as 'WITHOUT_EXAMPLE_STORAGE_ENGINE=1' and 'FEATURE_SET:STRING=large', for example, but with no effect. The installation size is usually around 2.1 GB, whereas the official Arch package, which also compiles from source, is about 231.78 MB.
The official Arch build script is here [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packag...], and the only difference I can notice is that they delete a lot of stuff afterwards. Is there any reference for stuff that can be deleted after MariaDB has been installed?
2.1 GB? *lol* * first learn to build packages * second split into subpackages * build only what you need * install only what you need [root@master:~]$ rpm -qa | grep mariadb | sort mariadb-10.2.15-1.0.fc27.20180518.rh.sandybridge.x86_64 mariadb-libs-10.2.15-1.0.fc27.20180518.rh.sandybridge.x86_64 mariadb-server-10.2.15-1.0.fc27.20180518.rh.sandybridge.x86_64 [root@master:~]$ dnf info mariadb mariadb-libs mariadb-server Last metadata expiration check: 0:00:10 ago on Sat May 19 09:25:31 2018. Installed Packages Name : mariadb Epoch : 6 Version : 10.2.15 Release : 1.0.fc27.20180518.rh.sandybridge Arch : x86_64 Size : 29 M Source : mariadb-10.2.15-1.0.fc27.20180518.rh.sandybridge.src.rpm Repo : @System
From repo : lounge-buildserver Summary : MariaDB client programs and shared libraries URL : https://downloads.mariadb.org/
Name : mariadb-libs Epoch : 6 Version : 10.2.15 Release : 1.0.fc27.20180518.rh.sandybridge Arch : x86_64 Size : 2.2 M Source : mariadb-10.2.15-1.0.fc27.20180518.rh.sandybridge.src.rpm Repo : @System
From repo : lounge-buildserver Summary : The shared libraries required for MariaDB clients URL : https://downloads.mariadb.org/
Name : mariadb-server Epoch : 6 Version : 10.2.15 Release : 1.0.fc27.20180518.rh.sandybridge Arch : x86_64 Size : 27 M Source : mariadb-10.2.15-1.0.fc27.20180518.rh.sandybridge.src.rpm Repo : @System
From repo : lounge-buildserver Summary : The MariaDB server and related files URL : https://downloads.mariadb.org/
[builduser@buildserver:/rpmbuild/SPECS]$ cat mariadb.spec # command 'rpmbuild -bb mariadb.spec --with production' will tune for current hardware while default stays 'sandybridge' %if %{?_with_production:1}%{!?_with_production:0} %global rh_mavx %{mavx_native} %global rpmsuffix native %global build_native_release 1 %global optflags $(sed "s/sandybridge/native/g" <<< "%{optflags}") %else %global rh_mavx avx %global rpmsuffix sandybridge %global build_native_release 0 %endif Name: mariadb Version: 10.2.15 Release: 1.%{build_native_release}%{?dist}.%{rpmsuffix} Epoch: 6 Summary: MariaDB client programs and shared libraries License: GPLv2 URL: https://downloads.mariadb.org/ Source0: %{name}-%{version}.tar.gz Source1: mysqld.service Source2: mysqld-dbmail.service Source3: mysqld-replication.service Source999: filter-requires-mysql.sh BuildRequires: bison BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: gperf BuildRequires: libaio-devel BuildRequires: libedit-devel BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: /usr/bin/perl BuildRequires: perl(Data::Dumper) BuildRequires: perl(Socket) BuildRequires: perl(Test::More) BuildRequires: perl(Time::HiRes) BuildRequires: procps-ng BuildRequires: systemd-devel BuildRequires: systemtap-sdt-devel BuildRequires: time BuildRequires: zlib-devel Requires: bash Requires: fileutils Requires: grep Requires: %{name}-libs = %{epoch}:%{version}-%{release} Provides: mysql = %{epoch}:%{version}-%{release}, mysql%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: mysql, community-mysql %global __perl_requires %{SOURCE999} %global __perllib_requires %{SOURCE999} %global _default_patch_flags --no-backup-if-mismatch %description MariaDB is a multi-user, multi-threaded SQL database server %package libs Summary: The shared libraries required for MariaDB clients Provides: mysql-libs = %{epoch}:%{version}-%{release}, mysql-libs%{?_isa} = %{epoch}:%{version}-%{release}, mariadb-connector-c = %{epoch}:%{version}-%{release}, mariadb-connector-c%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: mysql-libs, community-mysql-libs %description libs %package server Summary: The MariaDB server and related files Requires: %{name} = %{epoch}:%{version}-%{release}, %{name}-libs = %{epoch}:%{version}-%{release} Requires: sh-utils Requires(pre): shadow-utils Provides: mysql-server = %{epoch}:%{version}-%{release}, mysql-server%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: mysql-server, community-mysql-server %description server %package devel Summary: Files for development of MariaDB applications Requires: %{name} = %{epoch}:%{version}-%{release}, %{name}-libs = %{epoch}:%{version}-%{release} Requires: openssl-devel Provides: mysql-devel = %{epoch}:%{version}-%{release}, mysql-devel%{?_isa} = %{epoch}:%{version}-%{release}, mariadb-connector-c-devel = %{epoch}:%{version}-%{release}, mariadb-connector-c-devel%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: mysql-devel, community-mysql-devel %description devel %package test Summary: The test suite distributed with MariaDB Requires: %{name} = %{epoch}:%{version}-%{release}, %{name}-server = %{epoch}:%{version}-%{release} Requires: perl-DBD-MySQL, perl-DBI, perl-Env, perl-Memoize Provides: mysql-test = %{epoch}:%{version}-%{release}, mysql-test%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: mysql-test, community-mysql-test %description test %package manpages Summary: MariaDB manpages Provides: mysql-manpages = %{epoch}:%{version}-%{release}, mysql-manpages%{?_isa} = %{epoch}:%{version}-%{release} %description manpages %prep %setup -q -n %{name}-%{version} %build export CFLAGS="%{optflags} %{O3_flags} %{OS_flags} -m%{rh_mavx} -fPIC -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wno-stack-protector -Wa,--noexecstack" export CXXFLAGS="$CFLAGS -fno-rtti" export CPPFLAGS="$CFLAGS" export FFLAGS="$CFLAGS" export FCFLAGS="$CFLAGS" export SH_LDFLAGS="-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -Wl,-z,nodump %{optflags} %{O3_flags} %{OS_flags} -m%{rh_mavx} -fPIC -fwrapv -fno-stack-protector -fstack-protector --param=ssp-buffer-size=8 -fno-strict-aliasing -Wa,--noexecstack" export LDFLAGS="$SH_LDFLAGS -pie -fPIE" export GLIBC_TUNABLES="glibc.elision.enable=1" cmake . \ -DFEATURE_SET="large" \ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ -DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_LAYOUT=RPM \ -DDAEMON_NAME="mysqld" \ -DDAEMON_NO_PREFIX="mysqld" \ -DNICE_PROJECT_NAME="MariaDB" \ -DINSTALL_LIBDIR="%{_lib}/mysql" \ -DINSTALL_MANDIR=share/man \ -DINSTALL_MYSQLSHAREDIR=share/mysql \ -DINSTALL_MYSQLTESTDIR=share/mysql-test \ -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ -DINSTALL_SBINDIR=libexec \ -DINSTALL_SCRIPTDIR=bin \ -DINSTALL_SQLBENCHDIR= \ -DINSTALL_SUPPORTFILESDIR=share/mysql \ -DMYSQL_DATADIR="%{_sharedstatedir}/mysql" \ -DMYSQL_UNIX_ADDR="%{_sharedstatedir}/mysql/mysql.sock" \ -DENABLED_PROFILING=OFF \ -DENABLE_DEBUG_SYNC=OFF \ -DENABLE_DTRACE=OFF \ -DPLUGIN_ARIA=YES \ -DPLUGIN_CSV=YES \ -DPLUGIN_MYISAM=YES \ -DPLUGIN_ARCHIVE=NO \ -DPLUGIN_BLACKHOLE=NO \ -DPLUGIN_CASSANDRA=NO \ -DPLUGIN_CONNECT=NO \ -DPLUGIN_EXAMPLE=NO \ -DPLUGIN_FEDERATED=NO \ -DPLUGIN_FEDERATEDX=NO \ -DPLUGIN_FEEDBACK=NO \ -DPLUGIN_MROONGA=NO \ -DPLUGIN_MYISAMMRG=NO \ -DPLUGIN_OQGRAPH=NO \ -DPLUGIN_PARTITION=NO \ -DPLUGIN_PERFSCHEMA=NO \ -DPLUGIN_ROCKSDB=NO \ -DPLUGIN_SEMISYNC=NO \ -DPLUGIN_SEQUENCE=NO \ -DPLUGIN_SPHINX=NO \ -DPLUGIN_SPIDER=NO \ -DPLUGIN_TOKUDB=NO \ -DPLUGIN_XTRADB=NO \ -DWITHOUT_DYNAMIC_PLUGINS=ON \ -DWITH_ATOMIC_OPS=smp \ -DWITH_EMBEDDED_SERVER=OFF \ -DWITH_INNODB_DISALLOW_WRITES=OFF \ -DWITH_INNODB_BZIP2=OFF \ -DWITH_INNODB_LZ4=OFF \ -DWITH_INNODB_LZMA=OFF \ -DWITH_INNODB_LZO=OFF \ -DWITH_INNODB_SNAPPY=OFF \ -DWITH_MYSQLCOMPAT=ON \ -DSECURITY_HARDENED=OFF \ -DWITH_LIBARCHIVE=OFF \ -DWITH_LIBWRAP=OFF \ -DWITH_MARIABACKUP=OFF \ -DWITH_PIC=NO \ -DWITH_READLINE=OFF \ -DWITH_SAFEMALLOC=OFF \ -DWITH_VALGRIND=OFF \ -DWITH_WSREP=OFF \ -DWITH_JEMALLOC=OFF \ -DWITH_SSL=system \ -DWITH_ZLIB=system \ -DCOMPILATION_COMMENT="thelounge" %{__make} %{?_smp_mflags} %install make install DESTDIR=%{buildroot} sed -e 's/-lprobes_mysql//' -e 's/-lmysqlclient_r/-lmysqlclient/' %{buildroot}%{_bindir}/mysql_config > mysql_config.tmp cp -p -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config chmod 0755 %{buildroot}%{_bindir}/mysql_config chmod 0644 %{buildroot}%{_datadir}/mysql/*.sql ln -s ../../../../../bin/mysql_config %{buildroot}%{_libdir}/mysql/mysql_config mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d %{buildroot}%{_unitdir} install -m 0755 -d %{buildroot}%{_sharedstatedir}/mysql install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/mysqld.service install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/mysqld-dbmail.service install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/replication.service echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient_r.so* ln -s libmysqlclient.so %{buildroot}%{_libdir}/mysql/libmysqlclient_r.so mkdir -p %{buildroot}/%{_libdir}/pkgconfig mv %{buildroot}/%{_datadir}/pkgconfig/*.pc %{buildroot}/%{_libdir}/pkgconfig strip -s --strip-unneeded \ %{buildroot}%{_bindir}/aria_chk \ %{buildroot}%{_bindir}/aria_dump_log \ %{buildroot}%{_bindir}/aria_ftdump \ %{buildroot}%{_bindir}/aria_pack \ %{buildroot}%{_bindir}/aria_read_log \ %{buildroot}%{_bindir}/innochecksum \ %{buildroot}%{_bindir}/mariadb_config \ %{buildroot}%{_bindir}/my_print_defaults \ %{buildroot}%{_bindir}/myisam_ftdump \ %{buildroot}%{_bindir}/myisamchk \ %{buildroot}%{_bindir}/myisamlog \ %{buildroot}%{_bindir}/myisampack \ %{buildroot}%{_bindir}/mysql \ %{buildroot}%{_bindir}/mysql_client_test \ %{buildroot}%{_bindir}/mysql_plugin \ %{buildroot}%{_bindir}/mysql_tzinfo_to_sql \ %{buildroot}%{_bindir}/mysql_upgrade \ %{buildroot}%{_bindir}/mysql_waitpid \ %{buildroot}%{_bindir}/mysqladmin \ %{buildroot}%{_bindir}/mysqlbinlog \ %{buildroot}%{_bindir}/mysqlcheck \ %{buildroot}%{_bindir}/mysqldump \ %{buildroot}%{_bindir}/mysqlimport \ %{buildroot}%{_bindir}/mysqlshow \ %{buildroot}%{_bindir}/mysqlslap \ %{buildroot}%{_bindir}/mysqltest \ %{buildroot}%{_bindir}/perror \ %{buildroot}%{_bindir}/replace \ %{buildroot}%{_bindir}/resolveip \ %{buildroot}%{_libdir}/mysql/libmysqlclient.so* \ %{buildroot}%{_libdir}/mysql/libmariadb.so.* \ %{buildroot}%{_libexecdir}/mysqld rm -rf \ %{buildroot}%{_bindir}/msql2mysql \ %{buildroot}%{_bindir}/mysql_fix_extensions \ %{buildroot}%{_bindir}/mysql_secure_installation \ %{buildroot}%{_bindir}/mysql_setpermission \ %{buildroot}%{_bindir}/mysqlaccess.conf \ %{buildroot}%{_bindir}/mysqlbug \ %{buildroot}%{_bindir}/mysqld_multi \ %{buildroot}%{_bindir}/mysqld_safe \ %{buildroot}%{_bindir}/mysqld_safe_helper \ %{buildroot}%{_bindir}/mytop \ %{buildroot}%{_bindir}/resolve_stack_dump \ %{buildroot}%{_bindir}/tokuftdump \ %{buildroot}%{_datadir}/mysql/binary-configure \ %{buildroot}%{_datadir}/mysql/charsets/README \ %{buildroot}%{_datadir}/mysql/config.*.ini \ %{buildroot}%{_datadir}/mysql/install_spider.sql \ %{buildroot}%{_datadir}/mysql/magic \ %{buildroot}%{_datadir}/mysql/my-*.cnf \ %{buildroot}%{_datadir}/mysql/mysql-log-rotate \ %{buildroot}%{_datadir}/mysql/mysql.server \ %{buildroot}%{_datadir}/mysql/mysqld_multi.server \ %{buildroot}%{_datadir}/mysql/ndb-config-2-node.ini \ %{buildroot}%{_datadir}/mysql/policy/ \ %{buildroot}%{_datadir}/mysql/solaris/postinstall-solaris \ %{buildroot}%{_datadir}/mysql/wsrep.cnf \ %{buildroot}%{_datadir}/mysql/wsrep_notify \ %{buildroot}%{_datarootdir}/mysql/SELinux/ \ %{buildroot}%{_docdir}/COPYING \ %{buildroot}%{_docdir}/COPYING.LESSER \ %{buildroot}%{_docdir}/COPYING.thirdparty \ %{buildroot}%{_docdir}/CREDITS \ %{buildroot}%{_docdir}/EXCEPTIONS-CLIENT \ %{buildroot}%{_docdir}/INSTALL-BINARY \ %{buildroot}%{_docdir}/README \ %{buildroot}%{_docdir}/README-TOKUDB \ %{buildroot}%{_docdir}/README-wsrep \ %{buildroot}%{_docdir}/README.md \ %{buildroot}%{_libdir}/mysql/*.a \ %{buildroot}%{_libdir}/mysql/mysql_config \ %{buildroot}%{_libdir}/mysql/plugin/ \ %{buildroot}%{_libexecdir}/mysqld_safe_helper \ %{buildroot}%{_libexecdir}/rcmysql \ %{buildroot}%{_mandir}/man1/comp_err.1* \ %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1* \ %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1* \ %{buildroot}%{_prefix}/COPYING \ %{buildroot}%{_prefix}/INSTALL-BINARY \ %{buildroot}%{_prefix}/README \ %{buildroot}%{_prefix}/data/mysql/.empty \ %{buildroot}%{_prefix}/data/test/.empty \ %{buildroot}%{_prefix}/docs/ChangeLog \ %{buildroot}%{_sysconfdir}/init.d/mysql \ %{buildroot}%{_sysconfdir}/logrotate.d/mysql \ %{buildroot}%{_sysconfdir}/my.cnf \ %{buildroot}%{_sysconfdir}/my.cnf.d/ \ %{buildroot}/usr/bin/galera_new_cluster \ %{buildroot}/usr/bin/galera_recovery \ %{buildroot}/usr/bin/mariadb-service-convert \ %{buildroot}/usr/lib/systemd/system/mariadb.service \ %{buildroot}/usr/lib/systemd/system/mariadb@.service \ %{buildroot}/usr/lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf \ %{buildroot}/usr/share/mysql/systemd/mariadb.service \ %{buildroot}/usr/share/mysql/systemd/mariadb@.service \ %{buildroot}/usr/share/mysql/systemd/use_galera_new_cluster.conf \ %{buildroot}%{_sysusersdir}/sysusers.conf \ %{buildroot}%{_tmpfilesdir}/tmpfiles.conf rm -rf \ %{buildroot}/usr/share/mysql-test/plugin/connect \ %{buildroot}/usr/share/mysql-test/plugin/mroonga \ %{buildroot}/usr/share/mysql-test/plugin/rocksdb \ %{buildroot}/usr/share/mysql-test/plugin/sphinx \ %{buildroot}/usr/share/mysql-test/plugin/spider \ %{buildroot}/usr/share/mysql-test/plugin/tokudb \ %{buildroot}/usr/share/mysql-test/suite/archive \ %{buildroot}/usr/share/mysql-test/suite/binlog_encryption \ %{buildroot}/usr/share/mysql-test/suite/encryption \ %{buildroot}/usr/share/mysql-test/suite/federated \ %{buildroot}/usr/share/mysql-test/suite/galera \ %{buildroot}/usr/share/mysql-test/suite/mariabackup \ %{buildroot}/usr/share/mysql-test/suite/perfschema \ %{buildroot}/usr/share/mysql-test/suite/rocks* \ %{buildroot}/usr/share/mysql-test/suite/wsrep %pre server %{_sbindir}/groupadd -g 27 -o -r mysql &> /dev/null %{_sbindir}/useradd -M -N -g mysql -o -r -d /dev/null -s %{_sbindir}/nologin -c "MariaDB Server" -u 27 mysql &> /dev/null exit 0 %post server %systemd_post %{_bindir}/chmod 0755 %{_sharedstatedir}/mysql exit 0 %ldconfig_scriptlets -n mariadb-libs %files %{_bindir}/my_print_defaults %{_bindir}/mysql %{_bindir}/mysql_find_rows %{_bindir}/mysqlaccess %{_bindir}/mysqladmin %{_bindir}/mysqlbinlog %{_bindir}/mysqlcheck %{_bindir}/mysqldump %{_bindir}/mysqlimport %{_bindir}/mysqlshow %files libs %dir %{_libdir}/mysql %dir %{_datadir}/mysql %{_datadir}/mysql/charsets %{_datadir}/mysql/english %{_libdir}/mysql/libmariadb.so.* %{_sysconfdir}/ld.so.conf.d/* %lang(cs) %{_datadir}/mysql/czech %lang(da) %{_datadir}/mysql/danish %lang(de) %{_datadir}/mysql/german %lang(el) %{_datadir}/mysql/greek %lang(es) %{_datadir}/mysql/spanish %lang(et) %{_datadir}/mysql/estonian %lang(fr) %{_datadir}/mysql/french %lang(hi) %{_datadir}/mysql/hindi %lang(hu) %{_datadir}/mysql/hungarian %lang(it) %{_datadir}/mysql/italian %lang(ja) %{_datadir}/mysql/japanese %lang(ko) %{_datadir}/mysql/korean %lang(nl) %{_datadir}/mysql/dutch %lang(no) %{_datadir}/mysql/norwegian %lang(no) %{_datadir}/mysql/norwegian-ny %lang(pl) %{_datadir}/mysql/polish %lang(pt) %{_datadir}/mysql/portuguese %lang(ro) %{_datadir}/mysql/romanian %lang(ru) %{_datadir}/mysql/russian %lang(sk) %{_datadir}/mysql/slovak %lang(sr) %{_datadir}/mysql/serbian %lang(sv) %{_datadir}/mysql/swedish %lang(uk) %{_datadir}/mysql/ukrainian %files server %attr(0755,mysql,mysql) %dir %{_sharedstatedir}/mysql %{_bindir}/innochecksum %{_bindir}/myisamchk %{_bindir}/mysql_upgrade %{_bindir}/mysqldumpslow %{_bindir}/perror %{_datadir}/mysql/errmsg-utf8.txt %{_datadir}/mysql/maria_add_gis_sp.sql %{_datadir}/mysql/maria_add_gis_sp_bootstrap.sql %{_datadir}/mysql/mysql_performance_tables.sql %{_datadir}/mysql/mysql_system_tables.sql %{_datadir}/mysql/mysql_system_tables_data.sql %{_datadir}/mysql/mysql_to_mariadb.sql %{_libexecdir}/mysqld %{_unitdir}/mysqld-dbmail.service %{_unitdir}/mysqld.service %{_unitdir}/replication.service %files devel %{_bindir}/mariadb_config %{_bindir}/mysql_config %{_datarootdir}/aclocal/mysql.m4 %{_includedir}/mysql %{_libdir}/mysql/libmariadb.so %{_libdir}/mysql/libmysqlclient.so %{_libdir}/mysql/libmysqlclient_r.so %{_libdir}/pkgconfig/mariadb.pc %files test %attr(-,mysql,mysql) %{_datadir}/mysql-test %{_bindir}/aria_chk %{_bindir}/aria_dump_log %{_bindir}/aria_ftdump %{_bindir}/aria_pack %{_bindir}/aria_read_log %{_bindir}/myisam_ftdump %{_bindir}/myisamlog %{_bindir}/myisampack %{_bindir}/mysql_client_test %{_bindir}/mysql_convert_table_format %{_bindir}/mysql_plugin %{_bindir}/mysql_waitpid %{_bindir}/mysqlhotcopy %{_bindir}/mysqlslap %{_bindir}/mysqltest %{_bindir}/replace %{_bindir}/resolveip %{_datadir}/mysql/mysql_test_data_timezone.sql %files manpages %{_mandir}/man1/* %{_mandir}/man8/* %{_bindir}/mysql_install_db %{_bindir}/mysql_tzinfo_to_sql %{_datadir}/mysql/fill_help_tables.sql %changelog * Fri May 18 2018 Reindl Harald <h.reindl@thelounge.net> - update to 10.2.15
Hi, Reindl! On May 19, Reindl Harald wrote:
Am 19.05.2018 um 07:33 schrieb Tom Jay:
Has anyone got any idea how to reduce the MariaDB install size, when compiling from source? I've had multiple attempts, all with different options such as 'WITHOUT_EXAMPLE_STORAGE_ENGINE=1' and 'FEATURE_SET:STRING=large', for example, but with no effect. The installation size is usually around 2.1 GB, whereas the official Arch package, which also compiles from source, is about 231.78 MB.
The official Arch build script is here [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packag...], and the only difference I can notice is that they delete a lot of stuff afterwards. Is there any reference for stuff that can be deleted after MariaDB has been installed?
2.1 GB? *lol*
* first learn to build packages * second split into subpackages * build only what you need * install only what you need
Reindl, He's using *Arch*, right? Splitting in multiple rpm's or deb's won't help directly. But - thanks for the idea, they could still help. Tom, there're two approaches: RPM: files are split into packages by using cmake "components". Every installed file belongs to some component. And rpm builder uses this information to group them. But you don't need rpms, you can install a component directly with cmake -DCOMPONENT="componentname" -P cmake_install.cmake (untested, I've googled it). You can see the list of components and how they map to rpm packages in cmake/cpack_rpm.cmake (e.g. components Server, ManPagesServer, IniFiles, Server_Scripts, and SupportFiles all go into the "server" rpm package). DEB is doing it differently, see *.install files in debian/ directory. For example, if you want to install the client only, you'll only need files from mariadb-client-*.install. And dependencies. Regards, Sergei Chief Architect MariaDB and security@mariadb.org
Am 19.05.2018 um 10:27 schrieb Sergei Golubchik:
Hi, Reindl!
On May 19, Reindl Harald wrote:
Am 19.05.2018 um 07:33 schrieb Tom Jay:
Has anyone got any idea how to reduce the MariaDB install size, when compiling from source? I've had multiple attempts, all with different options such as 'WITHOUT_EXAMPLE_STORAGE_ENGINE=1' and 'FEATURE_SET:STRING=large', for example, but with no effect. The installation size is usually around 2.1 GB, whereas the official Arch package, which also compiles from source, is about 231.78 MB.
The official Arch build script is here [https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packag...], and the only difference I can notice is that they delete a lot of stuff afterwards. Is there any reference for stuff that can be deleted after MariaDB has been installed?
2.1 GB? *lol*
* first learn to build packages * second split into subpackages * build only what you need * install only what you need
Reindl, He's using *Arch*, right? Splitting in multiple rpm's or deb's won't help directly. But - thanks for the idea, they could still help
https://wiki.archlinux.org/index.php/pacman and pacman don't know the concept of sub-packages?
Hello, I'd like to thank everyone for their help on this. I checked the size of some of the folders that were installed during my initial installation, and found that these were the biggest files: lib/plugin/ ha_rocksdb.so lib/ libmysqld.so.19 libmysqld.a bin/ sst_dump mysql_ldb mysqltest_embedded mysql_client_test_embedded mysql_embedded mysqld mariabackup I therefore disabled most of them using the appropriate options (such as -DWITHOUT_ROCKSDB_STORAGE_ENGINE=1, -DWITH_EMBEDDED_SERVER=OFF, -DWITH_MARIABACKUP=OFF etc.) and now the install size is down to 476 MB. This is also a very helpful resource: https://mariadb.com/kb/en/library/choosing-the-right-storage-engine/ More documentation on the storage engines during compile time, in the Compiling MariaDB From Source/Generic Build Instructions section of the knowledge base, or more instructions on the compile time options, would be useful. Thanks again!
On 19.05.2018 07:33, Tom Jay wrote:
The installation size is usually around 2.1 GB
that does not sound right. I'm building from source quite often, OQgraph and TokuDB storage engines disabled, and for that e.g. MariaDB 10.3.5 comes out at slightly above 1.3GB being installed by "make install" If you want to have a smaller footprint you could delete the mysql-test directory from the installation, that directory takes >350M alone, and is not needed for production use at all. -- Hartmut Holzgraefe, Principal Support Engineer (EMEA) MariaDB Corporation | http://www.mariadb.com/
participants (4)
-
Hartmut Holzgraefe
-
Reindl Harald
-
Sergei Golubchik
-
Tom Jay