Increase the client side caching

For help and support with Universal Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
excaliburr
Posts: 27
Joined: Thu Feb 11, 2016 10:03 am

Increase the client side caching

Post by excaliburr » Fri Nov 03, 2017 3:04 pm

Hi

I am using an Android app that does caching of the server listings. When I add Minidlna or Gerbera the caching happens quite fast (like 30 songs a sec min) but when I add UMS it is very slow like max 5 songs a sec.

Is there a way to increase the size or lenght of these chunks sent to the client so it grabs the listings as fast as possible? I realize most upn players wont do such caching but this is the app I use due to some other advanced features it has.

Bear in mind that I am not talking about downloading the songs, only caching the directory listings.

thanks

User avatar
Nadahar
Developer
Posts: 919
Joined: Tue Jun 09, 2015 5:57 pm

Re: Increase the client side caching

Post by Nadahar » Fri Nov 03, 2017 3:54 pm

The speed of which UMS (or any media server) enumerates resources depends on many things. UMS does a lot of processing for each element and probably performs a lot of tasks that for example minidlna doesn't do. That will impact performance, as well as the fact the UMS is written in Java. Java is convenient in many ways, but is quite a bit slower than running "native" code. What matters most is the performance of the hardware UMS is running on. I don't know if you run minidlna and UMS from the same computer when you compare, but if you do and that computer is quite slow, the extra tasks done by UMS and the Java overhead is likely to make an impact.

There's nothing much you can do to improve UMS's speed except to make sure that it has enough RAM allocated and that UMS' cache feature is enabled. You can probably also gain some speed by turning of UMS functions like thumbnail generation, downloading of album art etc.

I have never experiences anything close to as slow as you are describing. 5 entries per seconds is extremely slow, so my guess is that the computer running UMS is very slow.

excaliburr
Posts: 27
Joined: Thu Feb 11, 2016 10:03 am

Re: Increase the client side caching

Post by excaliburr » Sat Nov 04, 2017 2:39 am

Nadahar

thanks for your reply. Your description makes sense. I did not think about the architectural differences when it comes to parsing data from the server.

The server's speed is fine when using something like BubbleUpnp, those type of apps do not do precaching like the app I use. The app I use actually queries the server and tries to download the whole listing back into its own database.

My desktop is fast enough it has quadcore 3ghz, 12 gb ram with ssd for the sys drive. It is a bit dated but not that slow. It is running Debian testing. It has some other server apps on it too.

I did the upnp tresting with all on the same computer. Both Gerbera and Minidlna vastly outperformed UMS in this particular test on the same desktop. UMS is sending roughly 5 songs a second, while I think Gerbara was hitting around 50 songs a sec. It was the fastest one.

WIth Gerbera I could cache around 20.000 songs listing on the device like around 10 min. I could not even wait long enough in UMS> It was taking hours. The funny thing was that as the number of songs was increasing the speed of precaching was slowing down with the UMS testing.

I realize these are not really scientific test, but might provide some idea.

User avatar
Nadahar
Developer
Posts: 919
Joined: Tue Jun 09, 2015 5:57 pm

Re: Increase the client side caching

Post by Nadahar » Sat Nov 04, 2017 3:02 am

Your computer should be more than fast enough to deliver much better performance than that. I wonder what the "app" you're using is actually doing. VLC takes "forever" to browse UMS, but that's because it browses the whole tree recursively so that it can "organize" the items itself before displaying them. UMS can have many "virtual" items listed and browsing it recursively will follow all these virtual resources to the very end. It's might even be possible to get a circular loop so that the recursive enumeration never ends.

It doesn't sound like that's what your "app" is doing though, but 5 per second is insanely slow. I'm suspecting that your "app" might be spamming with requests for the same resources multiple times. If so, it would explain why things were slowing to a crawl. Because of UMS' "dynamic nature", many things are done over and over again for each request in because the result might be different than it was the last time. This isn't optimized either, that is, no checks is done to check if things need to be resolved again - it simply depends on the "type" of resource. Some are "resolve once" and others (most) are "resolve every time". This is probably different for "less dynamic" implementations that basically returns the same result every time for the same query, and could be an explanation for the appalling speed.

If you generate debug files as described in red above, we might be able to see what's really going on.

excaliburr
Posts: 27
Joined: Thu Feb 11, 2016 10:03 am

Re: Increase the client side caching

Post by excaliburr » Sat Nov 04, 2017 3:41 am

I am using Neutron, it has a trial avail on Gplay.

Post Reply