Forum

Hiawahta cannot preload shared object file with LD_PRELOAD

samiux
5 February 2017, 17:16
Hi Hugo,

Hiawatha ignores the LD_PRELOAD and the shared object file cannot be preloaded.
Hugo Leisink
5 February 2017, 22:32
I don't know what LD_PRELOAD is supposed to do or what problem it should solve.
samiux
6 February 2017, 03:57
Hi Hugo,

I would like to use jemalloc (http://jemalloc.net/) to see if I can increase the performance of Hiawatha or not.
Hugo Leisink
6 February 2017, 09:38
Ok. Well, if you have any patches or suggestions to make Hiawatha work with LD_PRELOAD, let me know.
samiux
7 February 2017, 06:31
Hi Hugo,

jemalloc can be used for Hiawatha without any modification when using LD_PRELOAD.

It can also apply to MySQL and PHP7.0 too. By the way, you can consider to compile Hiawatha with jemalloc.

P.S. The previous problem was due to misconfiguration of apparmor on Ubuntu.
P.S 2 I cannot post the link for setup procedure

samiux
7 February 2017, 06:54
The setup guide is at my blog : Samiux's Blog. I am not allowed to post the link here

Another method is to add the following line into /lib/systemd/system/hiawatha.service :

Environment="LD_PRELOAD=/usr/local/lib/libjemalloc.so"
or
Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so"
This topic has been closed.