Skip to content

Commit 9bf901e

Browse files
committed
Run apache2 under jemalloc
jemalloc ends up resolving the memory fragmentation issues we've seen under APIv2 with the default glibc allocator. It should be relatively safe to swap in given how battle tested jemalloc is by much larger corporate users. See <freedomofpress/securedrop-client#3234 (comment)> and following comments. Fixes #7817.
1 parent 2c287d5 commit 9bf901e

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

securedrop/debian/app-code/etc/apparmor.d/usr.sbin.apache2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
/run/shm rw,
9393
/sbin/ldconfig rix,
9494
/sbin/ldconfig.real rix,
95+
/sys/kernel/mm/transparent_hugepage/enabled r,
9596
/tmp/** rwm,
9697
/usr/bin/ r,
9798
/usr/bin/dash rix,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Service]
2+
Environment=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2

securedrop/debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Package: securedrop-app-code
1010
Architecture: amd64
1111
Conflicts: libapache2-mod-wsgi, supervisor
1212
Replaces: libapache2-mod-wsgi, supervisor
13-
Depends: ${dist:Depends}, ${misc:Depends}, ${python3:Depends}, ${apparmor:Depends}, apache2, apparmor-utils, coreutils, gnupg2, libapache2-mod-xsendfile, paxctld, python3, redis-server, securedrop-config, securedrop-keyring, sqlite3
13+
Depends: ${dist:Depends}, ${misc:Depends}, ${python3:Depends}, ${apparmor:Depends}, apache2, apparmor-utils, coreutils, gnupg2, libapache2-mod-xsendfile, libjemalloc2, paxctld, python3, redis-server, securedrop-config, securedrop-keyring, sqlite3
1414
Description: SecureDrop application code, dependencies, Apache configuration, systemd services, and AppArmor profiles. This package will put the AppArmor profiles in enforce mode.
1515

1616
Package: securedrop-config

0 commit comments

Comments
 (0)