[prev in list] [next in list] [prev in thread] [next in thread]
List: apache-httpd-users
Subject: Re: [users@httpd] Apache keeping open deleted files
From: David Cunningham <dcunningham () voisonics ! com>
Date: 2016-04-19 5:09:13
Message-ID: CAHGbP--5yh1HjhkTNPrZRJN23dehp4xBniva37+dE4vEObt=wQ () mail ! gmail ! com
[Download RAW message or body]
Thank you for the replies Marat.
On 18 April 2016 at 20:33, Marat Khalili <mkh@rqc.ru> wrote:
> Well, apparently they are used as locks (mutexes) so that multiple Apache
> processes could safely access common resources. You can guess specific
> resources by file names. (Disclaimer: I'm not an Apache developer, probably
> one of them reading this will give better answer.)
>
> The process shouldn't need to end for the file to disappear - just the
> file descriptor to be closed.
>
> Yes, that's correct. What I wanted to say (but didn't) is such files
> disappear by themselves even if process that uses them ends abnormally and
> doesn't have chance to execute clean up.
>
> --
>
> With Best Regards,
> Marat Khalili
>
> On 18/04/16 12:49, David Cunningham wrote:
>
> Hi Marat,
>
> Thanks for the reply. Do you know why Apache keeps them open? The process
> shouldn't need to end for the file to disappear - just the file descriptor
> to be closed.
>
>
> On 18 April 2016 at 16:54, Marat Khalili <mkh@rqc.ru> wrote:
>
>> Hello David,
>>
>> It is a normal practice in Linux to delete temporary files immediately
>> after creating them. These files will still work for the process that keeps
>> them open, and will automatically disappear as soon as the process ends.
>>
>> I typed lsof /run/lock on a couple of my Ubuntu machines with Apache
>> installed, and the output was similar to yours.
>>
>> --
>>
>> With Best Regards,
>> Marat Khalili
>>
>> On 18/04/16 08:25, David Cunningham wrote:
>>
>> Hi,
>>
>> While reviewing filesystem usage we noticed lots of deleted files still
>> open by Apache, as reported by lsof. Some example lines are below.
>>
>> Can anyone advise why Apache is keeping these files open, and if there's
>> anything we can do about it? I have verified that the process numbers
>> listed are still existing processes.
>>
>> The server is running Apache 2.4.7-1ubuntu4.8 on Ubuntu 14.04 server,
>> 64bit. Thank you in advance.
>>
>> /usr/sbin 13262 root 23w REG
>> 0,19 0 110619773 /run/lock/apache2/rewrite-map.13262 (deleted)
>> /usr/sbin 13262 root 24w REG
>> 0,19 0 105844737 /run/lock/apache2/ssl-cache.13261 (deleted)
>> /usr/sbin 22669 apacheuser 23w REG
>> 0,19 0 110619773 /run/lock/apache2/rewrite-map.13262 (deleted)
>> /usr/sbin 22669 apacheuser 24w REG
>> 0,19 0 105844737 /run/lock/apache2/ssl-cache.13261 (deleted)
>> /usr/sbin 22669 22671 apacheuser 23w REG
>> 0,19 0 110619773 /run/lock/apache2/rewrite-map.13262 (deleted)
>> /usr/sbin 22669 22671 apacheuser 24w REG
>> 0,19 0 105844737 /run/lock/apache2/ssl-cache.13261 (deleted)
>> /usr/sbin 22669 22672 apacheuser 23w REG
>> 0,19 0 110619773 /run/lock/apache2/rewrite-map.13262 (deleted)
>> /usr/sbin 22669 22672 apacheuser 24w REG
>> 0,19 0 105844737 /run/lock/apache2/ssl-cache.13261 (deleted)
>> /usr/sbin 22669 22673 apacheuser 23w REG
>> 0,19 0 110619773 /run/lock/apache2/rewrite-map.13262 (deleted)
>> /usr/sbin 22669 22673 apacheuser 24w REG
>> 0,19 0 105844737 /run/lock/apache2/ssl-cache.13261 (deleted)
>> /usr/sbin 22669 22674 apacheuser 23w REG
>> 0,19 0 110619773 /run/lock/apache2/rewrite-map.13262 (deleted)
>> /usr/sbin 22669 22674 apacheuser 24w REG
>> 0,19 0 105844737 /run/lock/apache2/ssl-cache.13261 (deleted)
>>
>>
>> --
>> David Cunningham, Voisonics
>> http://voisonics.com/
>> USA: +1 213 221 1092 <%2B1%20213%20221%201092>
>> UK: +44 (0) 20 3298 1642
>> Australia: +61 (0) 2 8063 9019
>>
>>
>>
>
>
> --
> David Cunningham, Voisonics
> http://voisonics.com/
> USA: +1 213 221 1092
> UK: +44 (0) 20 3298 1642
> Australia: +61 (0) 2 8063 9019
>
>
>
--
David Cunningham, Voisonics
http://voisonics.com/
USA: +1 213 221 1092
UK: +44 (0) 20 3298 1642
Australia: +61 (0) 2 8063 9019
[Attachment #3 (text/html)]
<div dir="ltr">Thank you for the replies Marat.<br><br></div><div \
class="gmail_extra"><br><div class="gmail_quote">On 18 April 2016 at 20:33, Marat \
Khalili <span dir="ltr"><<a href="mailto:mkh@rqc.ru" \
target="_blank">mkh@rqc.ru</a>></span> wrote:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Well, apparently they are used as locks
(mutexes) so that multiple Apache processes could safely access
common resources. You can guess specific resources by file names.
(Disclaimer: I'm not an Apache developer, probably one of them
reading this will give better answer.)<span class=""><br>
<br>
<blockquote type="cite">The process shouldn't need to end for the
file to disappear - just the file descriptor to be \
closed.</blockquote></span>
Yes, that's correct. What I wanted to say (but didn't) is such
files disappear by themselves even if process that uses them ends
abnormally and doesn't have chance to execute clean up.<span class=""><br>
<br>
<div>
--<br>
<br>
With Best Regards,<br>
Marat Khalili<br>
<br>
</div></span><div><div class="h5">
On 18/04/16 12:49, David Cunningham wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div>Hi Marat,<br>
<br>
</div>
Thanks for the reply. Do you know why Apache keeps them open?
The process shouldn't need to end for the file to disappear -
just the file descriptor to be closed.<br>
<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 18 April 2016 at 16:54, Marat
Khalili <span dir="ltr"><<a href="mailto:mkh@rqc.ru" \
target="_blank">mkh@rqc.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> <div text="#000000" bgcolor="#FFFFFF">
<div>Hello David,<br>
<br>
It is a normal practice in Linux to delete temporary
files immediately after creating them. These files will
still work for the process that keeps them open, and
will automatically disappear as soon as the process
ends.<br>
<br>
I typed lsof /run/lock on a couple of my Ubuntu machines
with Apache installed, and the output was similar to
yours.<br>
<br>
<div> --<br>
<br>
With Best Regards,<br>
Marat Khalili<br>
<br>
</div>
<div>
<div> On 18/04/16 08:25, David Cunningham
wrote:<br>
</div>
</div>
</div>
<div>
<div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>Hi,<br>
<br>
</div>
While reviewing filesystem usage we noticed
lots of deleted files still open by Apache, as
reported by lsof. Some example lines are
below.<br>
<br>
</div>
Can anyone advise why Apache is keeping these
files open, and if there's anything we can do
about it? I have verified that the process
numbers listed are still existing processes.<br>
<br>
</div>
The server is running Apache 2.4.7-1ubuntu4.8 on
Ubuntu 14.04 server, 64bit. Thank you in advance.<br>
<br clear="all">
<div>
<div>
<div>
<div>
<div>/usr/sbin 13262 root
23w REG
0,19 0 110619773
/run/lock/apache2/rewrite-map.13262
(deleted)<br>
/usr/sbin 13262 root
24w REG
0,19 0 105844737
/run/lock/apache2/ssl-cache.13261
(deleted)<br>
/usr/sbin 22669 apacheuser
23w REG
0,19 0 110619773
/run/lock/apache2/rewrite-map.13262
(deleted)<br>
/usr/sbin 22669 apacheuser
24w REG
0,19 0 105844737
/run/lock/apache2/ssl-cache.13261
(deleted)<br>
/usr/sbin 22669 22671 apacheuser
23w REG
0,19 0 110619773
/run/lock/apache2/rewrite-map.13262
(deleted)<br>
/usr/sbin 22669 22671 apacheuser
24w REG
0,19 0 105844737
/run/lock/apache2/ssl-cache.13261
(deleted)<br>
/usr/sbin 22669 22672 apacheuser
23w REG
0,19 0 110619773
/run/lock/apache2/rewrite-map.13262
(deleted)<br>
/usr/sbin 22669 22672 apacheuser
24w REG
0,19 0 105844737
/run/lock/apache2/ssl-cache.13261
(deleted)<br>
/usr/sbin 22669 22673 apacheuser
23w REG
0,19 0 110619773
/run/lock/apache2/rewrite-map.13262
(deleted)<br>
/usr/sbin 22669 22673 apacheuser
24w REG
0,19 0 105844737
/run/lock/apache2/ssl-cache.13261
(deleted)<br>
/usr/sbin 22669 22674 apacheuser
23w REG
0,19 0 110619773
/run/lock/apache2/rewrite-map.13262
(deleted)<br>
/usr/sbin 22669 22674 apacheuser
24w REG
0,19 0 105844737
/run/lock/apache2/ssl-cache.13261
(deleted)<br>
<br>
<br>
-- <br>
<div>David Cunningham, Voisonics<br>
<a href="http://voisonics.com/" \
target="_blank">http://voisonics.com/</a><br>
USA: <a href="tel:%2B1%20213%20221%201092" \
value="+12132211092" target="_blank">+1 213 221 1092</a><br>
UK: <a \
href="tel:%2B44%20%280%29%2020%203298%201642" value="+442032981642" \
target="_blank">+44 (0) 20 3298 1642</a><br>
Australia: <a \
href="tel:%2B61%20%280%29%202%208063%209019" value="+61280639019" target="_blank">+61 \
(0) 2 8063 9019</a><br> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div>David Cunningham, Voisonics<br>
<a href="http://voisonics.com/" \
target="_blank">http://voisonics.com/</a><br>
USA: <a href="tel:%2B1%20213%20221%201092" value="+12132211092" \
target="_blank">+1 213 221 1092</a><br>
UK: <a href="tel:%2B44%20%280%29%2020%203298%201642" value="+442032981642" \
target="_blank">+44 (0) 20 3298 1642</a><br>
Australia: <a href="tel:%2B61%20%280%29%202%208063%209019" \
value="+61280639019" target="_blank">+61 (0) 2 8063 9019</a><br> </div>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">David \
Cunningham, Voisonics<br><a href="http://voisonics.com/" \
target="_blank">http://voisonics.com/</a><br>USA: +1 213 221 1092<br>UK: +44 (0) 20 \
3298 1642<br>Australia: +61 (0) 2 8063 9019<br></div> </div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic