Project

General

Profile

Has anyone else noticed that Tvheadend is suddenly taking a long time to start under Ubuntu 16.04 or similar versions?

Added by Sean Micklem about 6 years ago

First I should mention that once I have a working system that does what I want, I don't tend to upgrade Tvheadend until I am ready to do an operating system upgrade - if it ain't broke, don't fix it! So anyway there are three Tvheadend systems in my extended family that are all running under Ubuntu 16.04 server (no desktop) and that all in the past couple of months have developed a similar trait - they take what seems like forever to restart after a reboot. One is running Tvheadend version 4.2.3-113~g5ba8258, one is running 4.2.6-15~g88ae077 and I am not sure what the third one is running offhand but I think it may have been a 4.3.something version that was originally installed. They are running on different types of hardware as well. And up until a month or two ago, Tvheadend would restart after a reboot in a reasonable amount of time. But now, for some reason it seems like it takes Tvheadend 6 to 8 minutes to fully restart after a reboot, in other words to get to the point where the web interface and tuners are accessible.

Literally nothing has changed on these systems in months except that a few weeks ago one of them was upgraded from Ubuntu 14.04 to Ubuntu 16.04 (older Mac Mini that for whatever reason could not be upgraded to 18.04 at that time) and the current stable version of Tvheadend was installed at that time. And, all the normal Ubuntu upgrades have been applied. These are all Intel-based machines so my initial suspicion is that a Ubuntu upgrade brought in a CPU security fix that caused the machines to run slower, and for some reason this has REALLY impacted Tvheadend's startup, though that's really just a guess on my part.

Once Tvheadend is fully up it works with no problems, so I just have to be careful not to do a reboot when something is about to record. But I'm just a little puzzled as to why, on three different systems running three different versions of Tvheadend in different locations, this same slowness to start would occur, and I'm just curious as to whether anyone else has observed this. If this happens during a new install, and particularly if this same problem occurs under Ubuntu 18.04 or the current version of Debian, it could cause users to erroneously think that Tvheadend isn't working, when in fact they simply haven't waited long enough for it to fully start. I should mention that trying to manually start Tvheadend from the command line during this period does no good; it appears Tvheadend is already started or is in the process of starting, but just takes a long time to become available for use. Has anyone else noticed this?


Replies (5)

RE: Has anyone else noticed that Tvheadend is suddenly taking a long time to start under Ubuntu 16.04 or similar versions? - Added by Mark Clarkstone about 6 years ago

This is a known problem when a config has lots of files. If you use imagecache try emptying the folder (/home/hts/.hts/tvheadend/imagecache).

RE: Has anyone else noticed that Tvheadend is suddenly taking a long time to start under Ubuntu 16.04 or similar versions? - Added by Sean Micklem about 6 years ago

Mark Clarkstone wrote:

This is a known problem when a config has lots of files. If you use imagecache try emptying the folder (/home/hts/.hts/tvheadend/imagecache).

Well I can see there are tens of thousands of small files in that directory but I have no idea why, since I never turned on this "imagecache" thing and I don't know why or how it would be used. It appears that it creates new files whenever guide data is imported, but again I don't know for what purpose. So, I have three questions:

- If I empty the folder as you suggest will that cause any problems?

- Is there any way to stop new files from being created?

- I'm assuming that deleting these file would not have any impact on Kodi, which is what I use as my frontend, because it has its own ways of downloading images, right?

Thanks much!

EDIT: I found the Image Cache tab but the Enabled: checkbox is NOT checked, so I don't get why there were so many files. So I clicked "Clean image (icon) cache" and it looks like that blew away the entire /home/hts/.hts/tvheadend/imagecache directory! So I guess I'll see if it gets recreated and starts refilling after the next guide data import. FURTHER EDIT: And it did. The directory got recreated and several new files were added. :(

EDIT 2: I figured out where these are coming from - the XML file that contains my guide data has a line like this for every channel and show:

<icon src="https://some.link.to.a.png" />

But still can't understand why Tvheadend isn't ignoring those. Nor why the software that creates the listings is including those lines to begin with, but that's not a Tvheadend issue.

RE: Has anyone else noticed that Tvheadend is suddenly taking a long time to start under Ubuntu 16.04 or similar versions? - Added by Sean Micklem about 6 years ago

saen acro wrote:

Stop use image cache and setup some micro html server
https://acme.com/software/micro_httpd/

I don't want to use the image cache at all, but even though the Enabled: checkbox isn't checked, it has still been creating these files!

RE: Has anyone else noticed that Tvheadend is suddenly taking a long time to start under Ubuntu 16.04 or similar versions? - Added by Joe User about 6 years ago

First, and most important, did clearing the cache make the startup faster?

I haven't noticed a slowdown, but I checked my two systems. On both, the image cache enabled box is not checked. On the system which only uses ota epg, there is not even an imagecache directory. On the one which uses an internal grabber, the "/home/hts/.hts/tvheadend/imagecache/meta/" directory contains 38k small files (~60-70 bytes each). I checked the epg xml file and it does have icon src for each channel and each program. And when I look at the timestamps of the files, they correspond to the internal grabber cron setting.
Note: I do NOT have "update channel icon" checked in the epg grabber tab.

    (1-5/5)