old update_daemon-*.lock files sitting around

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
netllama
Bear Rating Trainee
Bear Rating Trainee
Posts: 47
Joined: 27 Sep 2009, 19:31

old update_daemon-*.lock files sitting around

Postby netllama » 17 Oct 2012, 05:19

I recently switched from getting updates via a cronjob to running update_daemon2.php as a daemon. I noticed that occasionally, update_daemon2.php seems to leave stale lock files sitting around. Currently, I've got the following:
###########
-rw-r--r-- 1 apache apache 6 Sep 21 22:12 update_daemon.lock
-rw-r--r-- 1 apache apache 5 Oct 4 00:40 update_daemon-2247.lock
-rw-r--r-- 1 apache apache 6 Oct 6 01:06 update_daemon-11292.lock
-rw-r--r-- 1 apache apache 6 Oct 6 01:14 update_daemon-11873.lock
-rw-r--r-- 1 apache apache 6 Oct 6 01:27 update_daemon-13237.lock
-rw-r--r-- 1 apache apache 6 Oct 6 01:39 update_daemon-14283.lock
-rw-r--r-- 1 apache apache 6 Oct 6 01:49 update_daemon-15280.lock
-rw-r--r-- 1 apache apache 6 Oct 6 02:01 update_daemon-16671.lock
-rw-r--r-- 1 apache apache 6 Oct 6 02:23 update_daemon-18690.lock
-rw-r--r-- 1 apache apache 6 Oct 6 02:31 update_daemon-19617.lock
-rw-r--r-- 1 apache apache 6 Oct 6 02:50 update_daemon-21489.lock
-rw-r--r-- 1 apache apache 6 Oct 6 02:56 update_daemon-22011.lock
-rw-r--r-- 1 apache apache 6 Oct 6 03:16 update_daemon-24023.lock
-rw-r--r-- 1 apache apache 6 Oct 6 03:22 update_daemon-24541.lock
-rw-r--r-- 1 apache apache 6 Oct 6 03:28 update_daemon-25054.lock
-rw-r--r-- 1 apache apache 6 Oct 6 03:36 update_daemon-25992.lock
-rw-r--r-- 1 apache apache 6 Oct 6 03:48 update_daemon-27544.lock
-rw-r--r-- 1 apache apache 6 Oct 6 03:52 update_daemon-27987.lock
-rw-r--r-- 1 apache apache 6 Oct 6 04:00 update_daemon-28931.lock
-rw-r--r-- 1 apache apache 6 Oct 6 04:13 update_daemon-29985.lock
-rw-r--r-- 1 apache apache 6 Oct 6 04:19 update_daemon-30524.lock
-rw-r--r-- 1 apache apache 6 Oct 6 04:31 update_daemon-31892.lock
-rw-r--r-- 1 apache apache 6 Oct 6 04:37 update_daemon-32401.lock
-rw-r--r-- 1 apache apache 4 Oct 6 04:45 update_daemon-873.lock
-rw-r--r-- 1 apache apache 5 Oct 6 04:53 update_daemon-1493.lock
-rw-r--r-- 1 apache apache 5 Oct 6 05:11 update_daemon-3584.lock
-rw-r--r-- 1 apache apache 5 Oct 6 05:17 update_daemon-4133.lock
-rw-r--r-- 1 apache apache 5 Oct 6 05:30 update_daemon-5155.lock
-rw-r--r-- 1 apache apache 5 Oct 6 05:36 update_daemon-6020.lock
-rw-r--r-- 1 apache apache 5 Oct 6 05:44 update_daemon-6594.lock
-rw-r--r-- 1 apache apache 5 Oct 6 05:50 update_daemon-7446.lock
-rw-r--r-- 1 apache apache 6 Oct 6 06:30 update_daemon-11411.lock
-rw-r--r-- 1 apache apache 6 Oct 6 06:38 update_daemon-11980.lock
-rw-r--r-- 1 apache apache 6 Oct 6 06:46 update_daemon-12898.lock
-rw-r--r-- 1 apache apache 6 Oct 6 06:55 update_daemon-13794.lock
-rw-r--r-- 1 apache apache 6 Oct 6 07:03 update_daemon-14428.lock
-rw-r--r-- 1 apache apache 6 Oct 9 10:36 update_daemon-25819.lock
-rw-r--r-- 1 apache apache 6 Oct 9 10:46 update_daemon-26817.lock
-rw-r--r-- 1 apache apache 6 Oct 9 10:52 update_daemon-27331.lock
-rw-r--r-- 1 apache apache 6 Oct 9 13:33 update_daemon-11747.lock
-rw-r--r-- 1 apache apache 4 Oct 11 04:17 update_daemon-635.lock
-rw-r--r-- 1 apache apache 5 Oct 11 05:28 update_daemon-7806.lock
-rw-r--r-- 1 apache apache 5 Oct 11 23:35 update_daemon-7875.lock
-rw-r--r-- 1 apache apache 5 Oct 11 23:44 update_daemon-8485.lock
-rw-r--r-- 1 apache apache 6 Oct 13 12:08 update_daemon-20079.lock
###########

I'm guessing its safe to delete these, but I'm wondering why they're still sitting around, days later? There are no current PIDs that match the numbers in the filenames.

thanks

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: old update_daemon-*.lock files sitting around

Postby fox » 21 Nov 2012, 00:13

You can safely delete those. They should be cleaned up, but sometimes they are not. I've never really investigated why this happens, you can make a simple find lock/ -type f -mtime +2 -name "*.lock" or something to remove those automatically.

netllama
Bear Rating Trainee
Bear Rating Trainee
Posts: 47
Joined: 27 Sep 2009, 19:31

Re: old update_daemon-*.lock files sitting around

Postby netllama » 21 Nov 2012, 00:22

ok thanks.

phz
Bear Rating Disaster
Bear Rating Disaster
Posts: 77
Joined: 18 Mar 2013, 18:32

Re: old update_daemon-*.lock files sitting around

Postby phz » 11 May 2013, 17:08

Necro-update: I guess that commit #1e253d1 resolved this issue.

imsinfo
Bear Rating Trainee
Bear Rating Trainee
Posts: 17
Joined: 07 May 2013, 20:00

Re: old update_daemon-*.lock files sitting around

Postby imsinfo » 04 Sep 2014, 03:12

After searching through the forums this is the closest I could find to the issue I am having. I seem to be having lock files that are being left behind, not a problem, I can delete those like you mentioned above. But, I think it is tied to another problem I am having. About every 30-40 minutes when the daemon finishes a batch I get this query below that ends up hanging in the "sending data" state.

After running the update_daemon2.php for a day or so I will have 10-15 of these queries left behind (with times of 30K+) and about the same amount of extra lock files left behind. I am not sure if these are tied together or not but from observation they seem to be... The queries begin to bog down the system and I am left to kill all of them to get the server to be responsive again.

Code: Select all

SELECT feed_url, site_url, title, COUNT( id ) AS subscribers
FROM ttrss_feeds
WHERE (

SELECT COUNT( id ) =0
FROM ttrss_feeds AS tf
WHERE tf.feed_url = ttrss_feeds.feed_url
AND (
private IS
TRUE OR auth_login !=  ''
OR auth_pass !=  ''
OR feed_url LIKE  '%:%@%/%'
)
)
GROUP BY feed_url, site_url, title
ORDER BY subscribers DESC
LIMIT 1000


Another thing is this only happens when I run "update_daemon2.php", when I try running "update.php --daemon" after the first batch is done it gets hung up here and will not progress any further.

Code: Select all

[22:14:31/22320] Removing old error log entries...


I had just about the same setup running tiny tiny before and I am not sure what is causing this to happen, any thoughts? Hopefully I have all the required info in the post so I don't get a bear! :lol:

I also don't get any errors in the error logs.
Running Centos 6.5 Final, PHP 5.3.3, APC, MySql 5.1.73, Tiny Tiny RSS v1.13

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: old update_daemon-*.lock files sitting around

Postby fox » 11 Sep 2014, 21:42

So what like the forked children don't ever terminate and the master just keeps spawning new ones? That's strange on both accounts because master should keep track of them not being properly dead and wait.

The query is the feedbrowser one. Do you have a lot of feeds? Like, multiple thousands or something?

imsinfo
Bear Rating Trainee
Bear Rating Trainee
Posts: 17
Joined: 07 May 2013, 20:00

Re: old update_daemon-*.lock files sitting around

Postby imsinfo » 17 Sep 2014, 22:04

Yeah, sounds about right. I switched to Postgres and all is working fine now. 100x's faster, should have used that like everyone says from the get go.

I'm guessing it's related to MySQL, tried tunning the DB and fresh installs as well and nothing seemed to improve it.

We do have a lot of feeds, about 25K over 30 accounts. Just switching to the new DB seemed to naturally solve the problem. I guess if no one else is having the issue we can call it case closed...

Thanks for the reply Fox, Tiny Tiny RSS has been a huge help to my everyday workflow.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 10 guests