Forum LAMS for Tech-Heads - General Forum: MySQL "dead" processes


 
You may request notification for MySQL "dead" processes.
Search: 

1: MySQL "dead" processes
09/21/09 12:15 AM
[ Reply | Forward ]
Getting quite a number of zombie processes in MySQL from LAMS. Seems to be a failed query (included below). Each process hogs 10% of CPU, so after a few days the server sits at 70% CPU (64 bit Win 2008 Server)


select distinct event0_.uid as uid0_, subscripti1_.uid as uid1_, event0_.default_message as default2_43_0_, event0_.default_subject as default3_43_0_, event0_.name as name43_0_, event0_.scope as scope43_0_, event0_.event_session_id as event6_43_0_, event0_.triggered as triggered43_0_, event0_.fail_time as fail8_43_0_, event0_.message as message43_0_, event0_.subject as subject43_0_, subscripti1_.last_operation_message as last2_44_1_, subscripti1_.periodicity as periodic3_44_1_, subscripti1_.user_id as user4_44_1_, subscripti1_.delivery_method_id as delivery5_44_1_, subscripti1_.last_operation_time as last6_44_1_, subscripti1_.event_uid as event7___, subscripti1_.uid as uid__ from lams_events event0_ left outer join lams_event_subscriptions subscripti1_ on event0_.uid=subscripti1_.event_uid, lams_event_subscriptions subscripti2_, lams_event_subscriptions subscripti3_, lams_event_subscriptions subscripti4_ where event0_.uid=subscripti4_.event_uid and event0_.uid=subscripti3_.event_uid and event0_.uid=subscripti2_.event_uid and (event0_.fail_time is not null or subscripti2_.periodicity>0 and now()-subscripti3_.last_operation_time>=subscripti4_.periodicity) order by subscripti1_.last_operation_time desc

Posted by Peter Vitez

2: Re: MySQL "dead" processes
In response to 1 09/21/09 02:53 AM
[ Reply | Forward ]
You can check mysql's slow queries counter by doing 'mysqladmin status -u root -p'. (mysqladmin binary is under the 'bin' directory in the MySQL program dir).

Are there any errors in the mysql error log? It's in the MySQL program directory, or the data directory.

Posted by Jun-Dir Liew

3: Re: Re: MySQL "dead" processes
In response to 2 09/21/09 08:37 PM
[ Reply | Forward ]
No errors in the log.

The query doesn't fail, it just runs forever. By executing the SQL query manually, it instantly becomes a dead process.

Can you identify the origin of the SQL statement? Is it from LAMS or Wildfire? I'm beginning to suspect wildfire, as the problem hasn't recurred since I turned it off a few hours ago.

Posted by Peter Vitez

4: Re: Re: MySQL "dead" processes
In response to 2 09/21/09 10:09 PM
[ Reply | Forward ]
Server monitor----------------
User: lams2
Host: WEBCME01:60221
db: lams2
Command:Query
Time: 4622
State: *** DEAD ***


MySQLadmin--------------------
C:\>mysqladmin status -u root -p
Enter password: ******
Uptime: 15258
Threads: 5
Questions: 1620134
Slow queries: 7
Opens: 1611
Flush tables: 1
Open tables: 121
Queries per second avg: 106.183

Posted by Peter Vitez

5: Re: Re: MySQL "dead" processes
In response to 2 09/22/09 12:32 AM
[ Reply | Forward ]
Sigh.

It wasn't Wildfire. Still got problem. I'll keep testing to find what activity sets it off...

Posted by Peter Vitez

6: Re: Re: Re: MySQL "dead" processes
In response to 5 09/22/09 01:10 AM
[ Reply | Forward ]
I just had a look at the event related code (I'm not familiar with it).

The query is run by the scheduler in order to resend unsuccessful events. Do you have a mail server configured in your lams configuration? If not, one possibility is that mail notifications build up in the events tables.

In any case, can you do a dump of your lams_events and lams_event_subscriptions tables and attach/send them? Using mysqldump:

mysqldump lams lams_events lams_event_subscriptions > C:\dump.sql -u root -p

where the first argument is the database name.

Posted by Jun-Dir Liew

7: Re: MySQL "dead" processes
In response to 1 09/23/09 08:12 PM
[ Reply | Forward ]
I also suspected the SMTP, as we initially did not set an SMTP server - but course components were trying to send notifications.
I added SMTP and turned of notifications, but the problem didn't go away.

The SQL dumps are a bit big. I'll email them to you.

Posted by Peter Vitez

8: Re: Re: MySQL "dead" processes
In response to 7 09/24/09 01:17 AM
[ Reply | Forward ]
Thanks for those, I imported your tables and ran the query in the first post - it hung for me as well and mysql is eating cpu time. I'll raise an issue for it and we'll see what we can do to mitigate the problem.

http://bugs.lamsfoundation.org/browse/LDEV-2445

Posted by Jun-Dir Liew

9: Re: Re: MySQL "dead" processes
In response to 7 09/27/09 05:42 PM
[ Reply | Forward ]
No more dead processes after installing your fix.
Thanks Jun

Posted by Peter Vitez

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum