You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Reindl Harald <h....@thelounge.net> on 2017/04/17 11:28:30 UTC

Apache leaves shared memory segments

https://bz.apache.org/bugzilla/show_bug.cgi?id=7838
that still happens with 2.4.25

"killall httpd 2> /dev/null" in a script starting a temporary httpd for 
php-pgo-profiling since it's a SIGTERM should not leave them and finally 
fail after enough runs to allocate shm segment for auth_digest until you 
reboot

  killall httpd 2> /dev/null
  sleep 2
  rm -f "$PROFILE_ROOT/php.ini"
  rm -f "$PROFILE_ROOT/httpd.conf"
  rm -f "$PROFILE_ROOT/logs/sess_"*
  rm -f "$PROFILE_ROOT/logs/authdigest"*
  rm -f "$PROFILE_ROOT/logs/httpd.pid"
  rm -f "$PROFILE_ROOT/logs/modsec"*

the 256 bytes are pretty clear from "AuthDigestShmemSize 256"

$HTTPD_BINARY -X -f "$PROFILE_ROOT/httpd.conf" to make sure there is 
only one httpd process should not take longer than the 2 seconds sleep 
given that it handles 1500 serial requests within 10 seconds before

[builduser@testserver:/rpmbuild/PHP-PGO]$ ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x661403ad 0          root       600        1000       2
0x151450bd 32769      root       600        1000       6
0x0121019a 65538      builduser  600        256        0
0xc121019a 98307      builduser  600        256        0
0x8621019a 131076     builduser  600        256        0


Re: Apache leaves shared memory segments

Posted by Reindl Harald <h....@thelounge.net>.
and also "-k stop" don't remove them

read HTTPD_PID < "$PROFILE_ROOT/logs/httpd.pid"
$HTTPD_BINARY -f "$PROFILE_ROOT/httpd.conf" -k stop
exit 0

[builduser@testserver:/rpmbuild/PHP-PGO]$ ipcs -m | wc -l
12
[builduser@testserver:/rpmbuild/PHP-PGO]$ ./profile.sh
[builduser@testserver:/rpmbuild/PHP-PGO]$ ipcs -m | wc -l
13
[builduser@testserver:/rpmbuild/PHP-PGO]$ ./profile.sh
[builduser@testserver:/rpmbuild/PHP-PGO]$ ipcs -m | wc -l
14

[builduser@testserver:/rpmbuild/PHP-PGO]$ ipcs -m
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x661403ad 0          root       600        1000       2
0x151450bd 32769      root       600        1000       6
0x0121019a 65538      builduser  600        256        0
0xc121019a 98307      builduser  600        256        0
0x8621019a 131076     builduser  600        256        0
0xdf21019a 163845     builduser  600        256        0
0x1b210199 196614     builduser  600        256        0
0x99210199 229383     builduser  600        256        0
0xe2210199 262152     builduser  600        256        0
0x5d210199 294921     builduser  600        256        0


Am 17.04.2017 um 13:28 schrieb Reindl Harald:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=7838
> that still happens with 2.4.25
> 
> "killall httpd 2> /dev/null" in a script starting a temporary httpd for 
> php-pgo-profiling since it's a SIGTERM should not leave them and finally 
> fail after enough runs to allocate shm segment for auth_digest until you 
> reboot
> 
>   killall httpd 2> /dev/null
>   sleep 2
>   rm -f "$PROFILE_ROOT/php.ini"
>   rm -f "$PROFILE_ROOT/httpd.conf"
>   rm -f "$PROFILE_ROOT/logs/sess_"*
>   rm -f "$PROFILE_ROOT/logs/authdigest"*
>   rm -f "$PROFILE_ROOT/logs/httpd.pid"
>   rm -f "$PROFILE_ROOT/logs/modsec"*
> 
> the 256 bytes are pretty clear from "AuthDigestShmemSize 256"
> 
> $HTTPD_BINARY -X -f "$PROFILE_ROOT/httpd.conf" to make sure there is 
> only one httpd process should not take longer than the 2 seconds sleep 
> given that it handles 1500 serial requests within 10 seconds before
> 
> [builduser@testserver:/rpmbuild/PHP-PGO]$ ipcs -m
> 
> ------ Shared Memory Segments --------
> key        shmid      owner      perms      bytes      nattch     status
> 0x661403ad 0          root       600        1000       2
> 0x151450bd 32769      root       600        1000       6
> 0x0121019a 65538      builduser  600        256        0
> 0xc121019a 98307      builduser  600        256        0
> 0x8621019a 131076     builduser  600        256        0