Re: Apache creates Semaphore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hemant,

as indicated in https://httpd.apache.org/docs/2.4/mod/core.html#mutex you can use different kind of mutex implementations and experiment with them. From your description though it seems to me that your approach of killing httpd leads to semaphore leaking, something that would be avoided with a graceful shutdown. I would encourage you to not use httpd -X but to configure your mpm to spawn one process only (note that you might need svn.apache.org/r1748336 or httpd >= 2.4.21).

Hope that helps,

Luca 

2017-11-02 12:08 GMT+01:00 Hemant Chaudhary <hemantdude.chaudhary@xxxxxxxxx>:
Hi Yann,

For my product I need to run apache as single process. As httpd -X works for me. But the issue is to stop httpd -X, we need to kill process. While killing the process, semaphore exists in kernel directory.
If I repeat for 10-15 times, then it will give error like no space available on device. 
To solve this error, either I need to explicitly kill each semaphore id and then start. So I thought not to create semaphore itself.
Therefore I commented following lines in worker.c 

if ((rv = SAFE_ACCEPT((apr_snprintf(id, sizeof id, "%i", i),ap_proc_mutex_create(&all_buckets[i].mutex,NULL, AP_ACCEPT_MUTEX_TYPE,  id, s, pconf, 0))))) {
           ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv, (startup ? NULL : s),  "could not create accept mutex");
                 return !OK;     

 After commenting above line, when I am starting httpd -X, it is giving signal 31 error. When starting with httpd, its only starting parent and killing child processes with signal 31 error.

What should I change if I want to start apache in debug mode and not to create semaphore ? 

Thanks
Hemant  
                       
            

On Thu, Nov 2, 2017 at 4:01 PM, Yann Ylavic <ylavic.dev@xxxxxxxxx> wrote:
Hi Hemant,

On Thu, Nov 2, 2017 at 5:47 AM, Hemant Chaudhary
<hemantdude.chaudhary@xxxxxxxxm> wrote:
>
> Semaphore is used in multi process environment to share resources within
> processes. But when I am starting apache in debug mode i:e single process
> then still it creates semaphore. May I know the reason why it is creating
> semaphore in debug mode also.

The debug mode has no particular code optimization or walkout,
precisely because we want to be able to diagnose potential bugs for
the non-debug case.

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux