Async MySQL and Apache issue
User:
mcholste
Date: 12/23/2011 12:49 pm
Date: 12/23/2011 12:49 pm
Views: 411
Rating: 0
Rating: 0
I'm seeing a problem with my implementation of async MySQL and
AnyEvent in which the filehandle that AnyEvent uses ($dbh->{mysql_fd})
goes into a CLOSE_WAIT state and AnyEvent freaks out, chewing up 100%
CPU until Apache can be restarted. Any tips for guarding against
this? Specifically, in AnyEvent, how do you detect that a filehandle
is in CLOSE_WAIT?
AnyEvent in which the filehandle that AnyEvent uses ($dbh->{mysql_fd})
goes into a CLOSE_WAIT state and AnyEvent freaks out, chewing up 100%
CPU until Apache can be restarted. Any tips for guarding against
this? Specifically, in AnyEvent, how do you detect that a filehandle
is in CLOSE_WAIT?
Re: Async MySQL and Apache issue
User:
hoelzro
Date: 12/25/2011 10:34 am
Date: 12/25/2011 10:34 am
Views: 0
Rating: 0
Rating: 0
I'm not too sure; I have little experience with Apache, and I don't think I've seen that problem myself. I wonder
if wrapping the fd in an AnyEvent::Handle and setting an on_error handler would do anything...
On Dec 23, 2011, at 12:49 PM, <mcholste@gmail.com> <mcholste@gmail.com> wrote:
mcholste wrote:
I'm seeing a problem with my implementation of async MySQL and
AnyEvent in which the filehandle that AnyEvent uses ($dbh->{mysql_fd})
goes into a CLOSE_WAIT state and AnyEvent freaks out, chewing up 100%
CPU until Apache can be restarted. Any tips for guarding against
this? Specifically, in AnyEvent, how do you detect that a filehandle
is in CLOSE_WAIT?
Madison Area Perl Mongers - MadMongers
http://www.madmongers.org
Re: Async MySQL and Apache issue
User:
mcholste
Date: 12/25/2011 1:38 pm
Date: 12/25/2011 1:38 pm
Views: 0
Rating: 0
Rating: 0
I figured this out: The issue was that I was making queries in a loop, and under certain conditions, hundreds of queries may be generated by the loop asynchronously. So, what I was experiencing was a symptom of MySQL being overwhelmed by too many queries at once.
On Sunday, December 25, 2011, <rob@hoelz.ro> wrote:
> hoelzro wrote:
>
> I'm not too sure; I have little experience with Apache, and I don't think I've seen that problem myself. I wonder
> if wrapping the fd in an AnyEvent::Handle and setting an on_error handler would do anything...
> On Dec 23, 2011, at 12:49 PM, <mcholste@gmail.com> <mcholste@gmail.com> wrote:
>
> mcholste wrote:
>
> I'm seeing a problem with my implementation of async MySQL and
> AnyEvent in which the filehandle that AnyEvent uses ($dbh->{mysql_fd})
> goes into a CLOSE_WAIT state and AnyEvent freaks out, chewing up 100%
> CPU until Apache can be restarted. Any tips for guarding against
> this? Specifically, in AnyEvent, how do you detect that a filehandle
> is in CLOSE_WAIT?
>
> View Online
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
>
> View Online
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
>
On Sunday, December 25, 2011, <rob@hoelz.ro> wrote:
> hoelzro wrote:
>
> I'm not too sure; I have little experience with Apache, and I don't think I've seen that problem myself. I wonder
> if wrapping the fd in an AnyEvent::Handle and setting an on_error handler would do anything...
> On Dec 23, 2011, at 12:49 PM, <mcholste@gmail.com> <mcholste@gmail.com> wrote:
>
> mcholste wrote:
>
> I'm seeing a problem with my implementation of async MySQL and
> AnyEvent in which the filehandle that AnyEvent uses ($dbh->{mysql_fd})
> goes into a CLOSE_WAIT state and AnyEvent freaks out, chewing up 100%
> CPU until Apache can be restarted. Any tips for guarding against
> this? Specifically, in AnyEvent, how do you detect that a filehandle
> is in CLOSE_WAIT?
>
> View Online
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
>
> View Online
>
> Madison Area Perl Mongers - MadMongers
> http://www.madmongers.org
>