Skip to content


Subversion checkout URL

You can clone with
Download ZIP


mysql and mariadb are bloated, probably due to static linking #172

edolstra opened this Issue · 9 comments

6 participants


Our MySQL 5.1 build is 50 MiB, while 5.5 is 152 MiB. It's mostly in the bin directory, which is 110 MiB. Apparently MySQL does some very bad static linking (for instance, the trivial MySQL utilities "replace" and "resolveip" are both almost 3 MiB).


@edolstra Have you looked into this? Will it make it into 14.04?


On a side note, mysql is such big also on other distros. Another thing is that binaries are not stripped for some reason, though stripping saves very little disk space (e.g. 3.2m instead of 3.3m for the mysql executable).


I think the answer is obvious, it was bought by Oracle :grimacing:.


Is this still relevant?


Now we have a bloated mariadb instead (by default) :-) but it's not too bad anymore:

36M     /nix/store/07f80n3kjncdnxvmfdysby824519vzgg-mariadb-10.0.21-lib
127M    /nix/store/gs3brddzpcxlsi0fh267rdn5bm9kpbrw-mariadb-10.0.21

(EDITed: I didn't give du enough time for the files to settle, i.e. likely free reserved extents.)

@vcunat vcunat closed this

To the actual issue:

143M    /nix/store/q9x4gy1k1xwyr5w3xm8cwy0vi9pkgsrh-mysql-5.5.45

After deleting lib/*.a in f7d5210:

120M    /nix/store/yky32ik5y42k5ra991wgkiymdvl9hgrc-mysql-5.5.45

That doesn't look too bloated to me in comparison, and mysql55 isn't in default closures anyway (anymore).


It is bloated, because all the binaries are kind of statically linked. They are dynamic, but the build process include something static into them. The binaries are huge, while they could be much smaller.

I've tried to investigate but cmake burns my mind.

@vcunat vcunat changed the title from Figure out why the MySQL 5.5 build is so insanely bloated to mysql and mariadb are bloated, probably due to static linking

Hmm, it seems Debian has much smaller sizes.

@vcunat vcunat reopened this

At least, what is in most closures, libmysqld, is about similar size. Maybe some plugins or other stuff could be removed from the default closure, I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.