モバイル&ワイヤレスブロードバンドでインターネットへ

gwaw.jp

Apache 2.4 で AH00144: couldn't grab the accept mutex

Ubuntu 18.04 LTS の Apache 2.4 で、WSGI の設定を追加してテストしていると、AH00144: couldn't grab the accept mutex のログを残して終了する事象が発生するようになりました。



[mpm_prefork:emerg] [pid 19262] (43)Identifier removed: AH00144: couldn't grab the accept mutex
[core:alert] [pid 19321] AH00050: Child 19262 returned a Fatal error... Apache is exiting!
[:emerg] [pid 19321] AH02818: MPM run failed, exiting

まず、Google 検索してみると、/etc/apache2/apache2.conf の Mutex の設定が関係しているようでした。



#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

この Mutex 行のコメントを外して様子をみているところです。いまのところ、同じ事象は発生していません。

https://httpd.apache.org/docs/2.4/en/mod/core.html#mutex を参照しておきます。

・file:/path/to/mutex

This selects the "best" available file locking implementation, choosing between fcntl and flock, in that order.

ファイルシステムを使用する場合、この file:/path/to/mutex がベストとあります。ほかの fcntl:/path/to/mutex と flock:/path/to/mutex についても念のためみておきます。

・fcntl:/path/to/mutex

This is a mutex variant where a physical (lock-)file and the fcntl() function are used as the mutex.

・flock:/path/to/mutex

This is similar to the fcntl:/path/to/mutex method with the exception that the flock() function is used to provide file locking.

また、セマフォ(Semaphore)を使用する場合、sem がベストとあります。

・sem

This selects the "best" available semaphore implementation, choosing between Posix and SystemV IPC semaphores, in that order.

posixsem(Posix semaphore)と、sysvsem(SystemV IPC semaphore)についてもみておきます。POSIX セマフォは、System V IPC セマフォより軽量という特徴があります。

・posixsem

This is a mutex variant based on a Posix semaphore.

・sysvsem

This is a mutex variant based on a SystemV IPC semaphore.

『Apache 2.4 で AH00144: couldn't grab the accept mutex』を公開しました。