← Back to team overview

maria-developers team mailing list archive

Re: Installing jemalloc on build VMs

 

We rolled some of our production MariaDB 5.2 machines with jemalloc
2.1.3. This the version that was available for our centos release. I
hacked up mysqld_safe to allow passing a --ld-preload option. It seems
strange to add a --ld-preload option. I did it for a few reasons.
First anyone looking at ps output clearly sees that the process is
running LD_PRELOAD. They can see what is loaded without having to dig
up the maps file. If anyone copies the command line to start their own
instance for whatever reason they also pick up the preload option. I
also added a log line that shows up like:
130426 08:57:03 mysqld_safe LD_PRELOAD set to /usr/lib64/libjemalloc.so.1

The hack is done such that LD_PRELOAD being passed through an
environment variable is also logged. The change is here if anyone is
interested:
http://bazaar.launchpad.net/~ebergen/maria/tivo/revision/2986?start_revid=2986

On Fri, Apr 26, 2013 at 8:52 AM, Gordan Bobic <gordan@xxxxxxxxxx> wrote:
> On Fri, 26 Apr 2013 17:41:14 +0200, Reindl Harald <h.reindl@xxxxxxxxxxxxx>
> wrote:
>>
>> * because wrapper-scripts are a bad idea on modern
>>   linux distributions and mysqld_safe is not needed there
>
>
> See below.
>
>
>> * because rpmbuild's automatic depsolve get useless without
>> * because 99 out of 100 applications have configure-switches
>>   to build with- or without optional libraries BUT the resulting
>>   binary has clear dependencies
>> * because LD_PRELOAD is nothing more than a hack
>
>
> It's an extremely useful hack that gets the job done in the cleanest
> way in cases where upstream distro maintenance committee's one size
> happens to not fit all.
>
>
>> example why mysqld_safe is no longer needed and this
>> runs in production since 2011 on a couple of servers
>>
>> [root@srv-rhsoft:~]$ systemctl status mysqld.service
>> mysqld.service - MySQL Database
>>    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
>>    Active: active (running) since Mi 2013-04-24 19:20:45 CEST; 1 day 22h
>> ago
>>  Main PID: 2312 (mysqld)
>>    CGroup: name=systemd:/system/mysqld.service
>>            └─2312 /usr/libexec/mysqld --defaults-file=/etc/my.cnf
>> --pid-file=/var/run/mysqld/mysqld.pid
>> --socket=/var/lib/mysql/mysql.sock --open-files-limit=500000
>> --basedir=/usr --user=mysql
>
>
> The only argument you are even close to making here is that mysqld_safe
> should be folded into mysqld.service, or whatever your $init uses.
> There is a good argument for keeping the common things in mysqld_safe
> and keeping the init script as minimal as possible to avoid having
> to maintain multiple complex init script for distributions using different
> inits (sysvinit, upstart, systemd, etc.).
>
> Gordan
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-developers
> Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-developers
> More help   : https://help.launchpad.net/ListHelp



-- 
Eric Bergen
eric.bergen@xxxxxxxxx
http://www.ebergen.net


References