Slow iSCSI read from Kodi
#1
Hi guys,
Long time lurker here, but I've been scratching my head on this one for long enough so I need some help please.

At home I have a raspberry pi3, currently running raspbian on a class 10 micoSD card, previously I had OSMC installed but for testing purposes I moved to raspbian. I have a dedicated user (Kodi) configured with a /home folder on a 16GB USB 3.0 device where Kodi is also installed (/home/Kodi/.kodi)

For storage I have a Thecus NAS which only support iSCSI presented LUNs. The NAS is connected to a gigabit switch and when presented to either my pc, my laptop, or the raspberry pi I get full speeds either reading or writing data.

The kicker is, Kodi will only read very erratically from the LUN (ext4) when it's presented to the pi3 via eth0, to the point where (using nload installed on the pi3) I've noticed speeds go from 300kb/s-4mb/s, with spikes to 8mb/s. This causes havoc when reading larger files (2gb+) and no amount of fiddling with the advancedsettings.xml file has helped.

For further testing I have installed NFS server on the pi3 and copied files from my pc & laptop, through the OS on the pi (either raspbian or OSMC) to the LUN and speeds have been constant and fine. The read speed issue only occurs when Kodi is reading from the drive.

At one point I thought it may have had something to do with permissions, but this turned out to be bogus. When I had OSMC running on the pi, I created a support thread on the OSMC support forum. Not sure if I'm allowed to link it here, but can do if it's felt it would help.

So, Kodi community, I seek your advice on how to achieve constant read speeds when watching media from an iSCSI presented LUN please.
Reply
#2
Take this as an educated guess only:
Kodi's file reading behaves differently between local HDDs and network file systems. Since iSCSI looks like a local HDD to Kodi, it assumes file access times and throughput are very good, so it reads in bursts to allow the hdd to spin down/save power as much as possible. This might actually be a PI specific optimization for flash drives.

Maybe @popcornmix has some insight here.
Reply
#3
That's an interesting thought, and something I'd not considered. Whilst I figured the issue was with Kodi, that makes a lot of sense.

I have tried to add the media via the browser, going to /mnt/iscsi in the root directory as well as selected the "mounted drive" in Kodi. Both methods yield the same results.
Reply
#4
No experience of iSCSI, but I'd try enabling the video cache (buffermode=1)
http://kodi.wiki/view/HOW-TO%3AModify_the_video_cache
Reply
#5
(2016-10-01, 13:55)popcornmix Wrote: No experience of iSCSI, but I'd try enabling the video cache (buffermode=1)
http://kodi.wiki/view/HOW-TO%3AModify_the_video_cache

Already suggested here: https://discourse.osmc.tv/t/slow-kodi-re...am_nazarko (same poster). I'm not sure if the XML changes were valid though.
Reply
#6
Yes, post a debug log (wiki) to see if the advancedsettings.xml was accepted.
Reply
#7
(2016-10-02, 21:37)popcornmix Wrote: Yes, post a debug log (wiki) to see if the advancedsettings.xml was accepted.

Will do, thank you very much for the suggestion.
Reply
#8
(2016-10-02, 21:37)popcornmix Wrote: Yes, post a debug log (wiki) to see if the advancedsettings.xml was accepted.

Debug log as requested: http://paste.ubuntu.com/23271447/
Reply
#9
advancedsettings.xml looks to have been read okay.
Code:
18:57:38 T:1945137728  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <network>
                                                <buffermode>1</buffermode>
                                                <!-- Comment: Default is 1 -->
                                                <cachemembuffersize>209715200</cachemembuffersize>
                                                <!-- Comment: Default is 20971520 bytes or 20 MB -->
                                                <readbufferfactor>20</readbufferfactor>
                                                <!-- Comment: Default is 1.0 -->
                                                <disableipv6>true</disableipv6>
                                              </network>
                                              <services>
                                                <esallinterfaces>true</esallinterfaces>
                                                <webserver>true</webserver>
                                                <zeroconf>true</zeroconf>
                                              </services>
                                            </advancedsettings>
Personally I wouldn't leave it at 200MB - it's rare that going above 20MB ever helps, and setting it too high may cause other issues (e.g. running out of memory).

It is quite an old kodi build. It might be worth trying a newer build. Either the PiPplware build for raspbian, or even better try OSMC or LibreELEC.
Not saying that will fix the issue, but it's something I would try.
Reply
#10
Hi,
Thanks for getting back to me. This was the build I got from the official raspbian repo. As I get the same results from previous OSMC builds, I'm tempted to say it's Kodi-wide regardless of platform.

How would I go about forcing an upgrade to a newer version?
Reply
#11
(2016-10-04, 16:48)Schnippzle Wrote: Hi,
Thanks for getting back to me. This was the build I got from the official raspbian repo. As I get the same results from previous OSMC builds, I'm tempted to say it's Kodi-wide regardless of platform.

How would I go about forcing an upgrade to a newer version?

If you've got a spare sdcard, then I'd try a LibreELEC Krypton build.
That has latest everything (including 4.7 kernel), so if any update is going to help, that is your best chance.
Reply
#12
Ok thanks! I will give it a try and report back Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Slow iSCSI read from Kodi0