<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=HTTPD_Semaphore%2FMutex_Lock_Problem</id>
	<title>HTTPD Semaphore/Mutex Lock Problem - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=HTTPD_Semaphore%2FMutex_Lock_Problem"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=HTTPD_Semaphore/Mutex_Lock_Problem&amp;action=history"/>
	<updated>2026-05-26T01:39:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.docking.org/index.php?title=HTTPD_Semaphore/Mutex_Lock_Problem&amp;diff=13110&amp;oldid=prev</id>
		<title>Jgutie11 at 00:54, 26 November 2020</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=HTTPD_Semaphore/Mutex_Lock_Problem&amp;diff=13110&amp;oldid=prev"/>
		<updated>2020-11-26T00:54:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:54, 26 November 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot;&gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  max ops per semop call = 32&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  max ops per semop call = 32&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  semaphore max value = 32767&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  semaphore max value = 32767&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Sysadmin]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jgutie11</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=HTTPD_Semaphore/Mutex_Lock_Problem&amp;diff=13109&amp;oldid=prev</id>
		<title>Jgutie11: Created page with &quot; == Introduction == Httpd failing due to not having enough space to make semaphore/mutex locks.   When doing systemctl restart httpd, semaphores are not destroyed properly and...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=HTTPD_Semaphore/Mutex_Lock_Problem&amp;diff=13109&amp;oldid=prev"/>
		<updated>2020-11-26T00:52:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Introduction == Httpd failing due to not having enough space to make semaphore/mutex locks.   When doing systemctl restart httpd, semaphores are not destroyed properly and...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Httpd failing due to not having enough space to make semaphore/mutex locks. &lt;br /&gt;
&lt;br /&gt;
When doing systemctl restart httpd, semaphores are not destroyed properly and the locks are accumulated until it reaches the max capacity.&lt;br /&gt;
&lt;br /&gt;
== Lock Error ==&lt;br /&gt;
Check the error_log in /etc/httpd/logs/error_log. If this error exists then follow the solution:&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;[Wed Nov 25 12:27:57.636689 2020] [core:emerg] [pid 24252] (28)No space left on device: AH00023: Couldn&amp;#039;t create the mpm-accept mutex&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Solution ==&lt;br /&gt;
Do the following:&lt;br /&gt;
 * vim /usr/lib/systemd/system/httpd.service&lt;br /&gt;
 add this line before ExecStart: &amp;#039;&amp;#039;&amp;#039;ExecStartPre=/bin/sh -c &amp;quot;for i in `ipcs -s | awk &amp;#039;/httpd/ {print $2}&amp;#039;`; do (ipcrm -s $i); done&amp;quot;&amp;#039;&amp;#039;&amp;#039; //clear httpd semaphores each restart&lt;br /&gt;
 comment this line: &amp;#039;&amp;#039;&amp;#039;KillSignal=SIGKILL&amp;#039;&amp;#039;&amp;#039; //This does not gracefully destroy locks&lt;br /&gt;
 save&lt;br /&gt;
 ipcs -s | awk -v user=apache &amp;#039;$3==user {system(&amp;quot;ipcrm -s &amp;quot;$2)}&amp;#039; //clear previous httpd locks&lt;br /&gt;
 systemctl restart httpd&lt;br /&gt;
=== Double Check ===&lt;br /&gt;
Do the following commands:&lt;br /&gt;
 ipcs -s | grep apache | wc -l //displays number of locks used by apache&lt;br /&gt;
 systemctl restart httpd&lt;br /&gt;
 ipcs -s | grep apache | wc -l //again to see if locks increased unnecessarily&lt;br /&gt;
If the locks amount stay the same you are good to go.&lt;br /&gt;
&lt;br /&gt;
== Increase Semaphore Locks capacity ===&lt;br /&gt;
 vim /etc/sysctl.d/99-sysctl.conf&lt;br /&gt;
 add this line: &amp;#039;&amp;#039;&amp;#039;kernel.sem = 250 256000 32 1024&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 save&lt;br /&gt;
 sysctl -p //reload rules&lt;br /&gt;
&lt;br /&gt;
Check if rules applied with:&lt;br /&gt;
 ipcs -ls&lt;br /&gt;
 ------ Semaphore Limits --------&lt;br /&gt;
 max number of arrays = 1024&lt;br /&gt;
 max semaphores per array = 250&lt;br /&gt;
 max semaphores system wide = 256000&lt;br /&gt;
 max ops per semop call = 32&lt;br /&gt;
 semaphore max value = 32767&lt;/div&gt;</summary>
		<author><name>Jgutie11</name></author>
	</entry>
</feed>