Windows 7 x86 poor SMB Performance
#1
Hi

Im new to this forum so please forgive if this has been answered. I've searched but came up with no usefull results. Im pretty new to XBMC as well so there might be some things I've missed out on.

I've got a Windows Server 2008 R2 SP1 host running my file shares, and it sits on a gigabit port, delivering in excess of 600 Mbps (measured using IPerf) to other gigabit hosts. I've put XBMC on my laptop, which is a fair lenovo thing, not top notch, however it's been playing anything I've got using VLC or Media Player classic so far. It's only on a 100 Mbit nic, but measures 90 Mbps + on every test to the server. This should be plenty for playing any HD content one could possibly throw at it, however for some reason high bitrate movies seems to cause me trouble when playing them through XBMC.

Playback itself is fine, however every minute or so XBMC needs to rebuffer. Looking into the debug log which can be found at http://pastebin.com/VLx3EdJu it seems both that XBMC works in the background gathering thumbnails and that the video requires some re-syncs during playback, I cannot tell wether this is normal behavior or not, however when I analyse the network usage characteristiscs and compare it to when VLC plays backs, XBMC does not put a constant load on the network connection, but jumps up and down erratically, where VLC constantly loads the network connection varying in bandwidth consumption.

The laptop is fitted with 4 GB memory. At no time is the CPU load above 40% and Memory consumption above 60%

From the debug log:
Starting XBMC (11.0-RC2 Git:20120229-f38655f), Platform: Windows 7, 32-bit Service Pack 1 build 7601. Built on Feb 29 2012 (compiler 1600)
Intel® Core™2 Duo CPU T6600 @ 2.20GHz
Desktop Resolution: 1366x768 32Bit at 60Hz <-- This will also be output through HDMI to a Samsung 1080p display, however its not the gfx performance which gives me trouble here.
Running with administrator rights
Aero is enabled

MediaInfo can be found here: http://pastebin.com/RRMr0GjY

The way XBMC addresses SMB paths make me suspect that it uses its own SMB implementation and not the native MS API's, however that is pure speculation of course. The reason why this is interesting to me, is I've seen production issues with applications using non standard SMB libraries in the past.

Measuring remote to local file transfers I am hitting the roof at low enough transfer speeds to give me trouble at 40 MBps... however that is because the local disk in the laptop isn't exactly porsche style, but for that to give any issues with playback would require XBMC to do local caching, which I assume is not the case.

I am running XBMC in portable mode, and its linked to a MySQL database also hosted on the Win2k8 R2 machine. It does however not make any difference if I use a local installation running in non-portable mode and not using MySQL.

Can anyone give me some pointers as to why I see this issue? This is not the only movie btw.

Thanks in advance.

- Sharza
Reply
#2
What if you map the drives on the laptop then add the source as a local drive (bypassing XBMC's smb)?

-Also try turning off thumbnail extraction in video settings.
-Use IP address for Win2k8 server in 'add network location' instead of 'media'
Reply
#3
(2012-03-20, 17:05)live4ever Wrote: What if you map the drives on the laptop then add the source as a local drive (bypassing XBMC's smb)?

-Also try turning off thumbnail extraction in video settings.
-Use IP address for Win2k8 server in 'add network location' instead of 'media'

I will try local map and thumbnail extraction as soon as I come home, just to see.

I already use the IP address for the server, the share name is "media" as well as the account.

- Sharza
Reply
#4
(2012-03-20, 15:18)sharza Wrote: The way XBMC addresses SMB paths make me suspect that it uses its own SMB implementation and not the native MS API's, however that is pure speculation of course. The reason why this is interesting to me, is I've seen production issues with applications using non standard SMB libraries in the past.

XBMC uses the native MS API's to access smb shares. The url path scheme is corss platform compatible and we just rewrite it to MS paths in the designated class.
How XBMC caches the network traffic is something our dvdplayer gurus have to answer.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#5
(2012-03-20, 22:20)WiSo Wrote: XBMC uses the native MS API's to access smb shares. The url path scheme is corss platform compatible and we just rewrite it to MS paths in the designated class.
How XBMC caches the network traffic is something our dvdplayer gurus have to answer.
T
Sounds good, that is one less thing to consider. That _should_ be proven when I attempt to play the file through a locally mapped unc path later on.

Wonder if the caching method should have anything to do with that. I've tried to increase the cache mem buffers setting in the advancedsettings.xml file, however that didn't really change anything, except there was an indeterminate amount of increased time between rebuffering (have to admit I didn't time it with different settings, I might try that if it becomes truly relevant later on).
Reply
#6
I had the exact same issue a while ago - it turned out to be a bad cable end. I re-terminated the cable and the problem was resolved. In the process I found that switches can act very different. One switch the cable did not work at all (showed no connection), another older, higher-powered switch made the connection... I assume because of the higher power output.
I'm not an expert but I play one at work.
Reply
#7
Its not the cable. It clocks at 90 Mbps ++ in any measurement. Wireshark shows no retransmits, and just to make sure I swapped the cable as well.

I tried playing the file of a locally mapped UNC path, and the results was the same. As earlier mentioned the hard drive in the laptop is a slowbie 4200 rpm thing, which at its best delivers around 7 MB/s read speeds, but it varies alot and mostly is between 3 - 5 MB/s. This is more than 50% below the actual performance I get over the 100 MBps network link. Just for the fun of it I copied the movie to the local drive, and for some reason it plays flawlessly there, no rebuffering at all ... this puzzles me alot, as theoretically the slow drive should prove a challenge, considering the max bitrate in the movie is 40 Mbps, and the drive read speeds is unable to deliver that much data most of the time (I know that 40 Mbps is peak as its vbr, but in heavy action scenes we should be around that value.). So why is it that the network link which provides more than double the performance transfer wise is suffering?? That is just plain weird.

I cant help thinking it must be the way XBMC accesses the file over SMB, since its the only media player suffering from this (compared to Windows Media Player, Media Player Classic and VLC). I am also thinking of those warnings in the debug log... they may be significant in this matter.
Reply
#8
sharza, I agree with your last post. something is awry with SMB access via XBMC. I have found smb to be unusable on high bitrate files and have had to resort to ftp.

(2012-03-21, 15:46)sharza Wrote: ....
I cant help thinking it must be the way XBMC accesses the file over SMB, since its the only media player suffering from this (compared to Windows Media Player, Media Player Classic and VLC). I am also thinking of those warnings in the debug log... they may be significant in this matter.
...

Reply
#9
(2012-03-21, 16:00)kedda Wrote: sharza, I agree with your last post. something is awry with SMB access via XBMC. I have found smb to be unusable on high bitrate files and have had to resort to ftp.

So did FTP resolve the issue, and more importantly is FTP configured in the same manner as SMB (so that it will be universally accessible on the network, given I use a centralized MySQL library and server).

I could easily enable the access via FTP, as that is already in place however not serving access to media files.

Reply
#10
Have you tried completely removing the cachemembuffersize from your advancedsettings.xml? It shouldn't be necessary at all.

What NIC chipset have you got on the Lenovo? Realtek?

Finally, you REALLY shouldn't have to considering you're on 2008 R2 SP1 and Windows 7 SP1 but you could try disabling SMB2 on the server. It's a simple test that can be fairly quickly turned off and on.

Regedit.. go to HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters
Add a new REG_DWORD key with the name of "Smb2" (without quotation mark) and give it a value of 0.
0 = disabled
1 = enabled
Reboot. If it doesn't make a difference just delete the key and reboot again.

It'd be interesting to see whether it makes a difference but it really shouldn't (I have a very similar setup to you and didn't need to disable SMB2)
Reply
#11
(2012-03-21, 16:43)vexation Wrote: Have you tried completely removing the cachemembuffersize from your advancedsettings.xml? It shouldn't be necessary at all.
That was the initial setting.

Quote:What NIC chipset have you got on the Lenovo? Realtek?
Hmm.... Not too sure, might be realtek - however it shouldn't be of any relevance given standard API's used and basicly anything but XBMC performs great on the network. I'll update this when I get home to the laptop and can verify it.


Quote:Finally, you REALLY shouldn't have to considering you're on 2008 R2 SP1 and Windows 7 SP1 but you could try disabling SMB2 on the server. It's a simple test that can be fairly quickly turned off and on.

Regedit.. go to HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters
Add a new REG_DWORD key with the name of "Smb2" (without quotation mark) and give it a value of 0.
0 = disabled
1 = enabled
Reboot. If it doesn't make a difference just delete the key and reboot again.

It'd be interesting to see whether it makes a difference but it really shouldn't (I have a very similar setup to you and didn't need to disable SMB2)
There is no way this could improve anything, not between Win7 and Win2k8 R2. SMB2 will outperform SMB in any test you can possibly throw at it, so it would surprise me immensely if this should provide any improvement whatsoever (again considering standard API's being used).

I will however perform this simple test when I have a spare moment to do so... rebooting the server takes some time and is a pain in the butt Smile... I'll update with the results some time tomorrow.
Reply
#12
(2012-03-21, 17:13)sharza Wrote: There is no way this could improve anything, not between Win7 and Win2k8 R2. SMB2 will outperform SMB in any test you can possibly throw at it, so it would surprise me immensely if this should provide any improvement whatsoever (again considering standard API's being used).

I will however perform this simple test when I have a spare moment to do so... rebooting the server takes some time and is a pain in the butt Smile... I'll update with the results some time tomorrow.

Oh I know it SHOULDN'T make a difference (and believe me being a server admin for various companies I tire of people who immediately suggest disabling SMB2, Remote Differential Compression, Autotuning, offloading etc etc) I'm just curious. I'd be very surprised if it made a difference but it only takes a few minutes to test (unless your server takes forever to reboot.. 2008 R2 tends to be pretty awesome in that regard tho)

When you say that cachemembuffersize is in the initial setting, have you copy+pasted that from somewhere else? advancedsettings.xml doesn't exist by default and I've never needed to specify the cachemembuffersize on any XBMC machines + most of my players are more underpowered than yours (i.e nVidia ION with wireless). I think the default has been 5MB forever (although maybe it's changed recently and I didn't notice).

As backwards as it sounds, have you tried using the laptops wireless instead of the LAN to rule out any LAN NIC issues? (I say that because even if you're getting great transfer rates, there might be enough latency here and there to cause the buffering) - I asked about the Realtec NIC because of http://forum.xbmc.org/showthread.php?tid=94330 - also their Realteks Interrupt Moderation implementation on certain systems can cause bad latency spikes that don't show up in a file transfer but do show up in real world usage.
Reply
#13
(2012-03-21, 18:02)vexation Wrote: Oh I know it SHOULDN'T make a difference (and believe me being a server admin for various companies I tire of people who immediately suggest disabling SMB2, Remote Differential Compression, Autotuning, offloading etc etc) I'm just curious. I'd be very surprised if it made a difference but it only takes a few minutes to test (unless your server takes forever to reboot.. 2008 R2 tends to be pretty awesome in that regard tho)
Well I agree on that part, however most of the time the reason for many of those "too-quick-and-standard" suggestions are simple lack of knowledge, I should believe I'm fairly well founded with regards to that, or I should probably look for another job Smile

Given Im in a very low latency environment, autotuning etc. is out of the question, as data on wire makes no real difference here, so manual control of tcp window scaling etc would make very little sense (we're talking < 1 ms). In fact it might have an adverse effect trying to manually control that.

Offloading is really a long shot as well, as the CPU's are below 40-50% at any given time, so that wouldn't provide any benefit.

Quote:When you say that cachemembuffersize is in the initial setting, have you copy+pasted that from somewhere else? advancedsettings.xml doesn't exist by default and I've never needed to specify the cachemembuffersize on any XBMC machines + most of my players are more underpowered than yours (i.e nVidia ION with wireless). I think the default has been 5MB forever (although maybe it's changed recently and I didn't notice).
I've created the advancedsettings.xml myself (considering I use MySQL Wink ). What i meant when I said it was the initial setting, is in fact that it was not present in the xml file to begin with, and I added it out of curiosity and played around with it to see if it made a difference whatsoever.

Quote:As backwards as it sounds, have you tried using the laptops wireless instead of the LAN to rule out any LAN NIC issues? (I say that because even if you're getting great transfer rates, there might be enough latency here and there to cause the buffering) - I asked about the Realtec NIC because of http://forum.xbmc.org/showthread.php?tid=94330 - also their Realteks Interrupt Moderation implementation on certain systems can cause bad latency spikes that don't show up in a file transfer but do show up in real world usage.
I haven't done that, as there is no way I can sustain 40 Mbps video over a wireless link regardless of the specs, so it wouldn't help me rule out anything I'm afraid.

I have allready tuned the NIC (no interrupt moderation and fully increased send/receive buffers) as well as attempted disabling the flow control to absolutely max out performance on the network layer, it didn't do anything.

Besides all of this, iPerf'ing a network connection and seeing it reach 90% of its potential is in almost any case a very solid indication that performance on layer 3 is flawless, and that the culprit is located on the higher layers.

You've made me curious enough tho' that I'll attempt disabling SMB2, and maybe even play around with the other settings... just to see. The OS itself is booting lightning fast sitting on a SATA-600 SSD, however posting past the raid controller etc takes forever Smile

I will try playing around if FTP as well if none of this helps.
Reply
#14
Hi!

Not sure if this helps but I had a similar problem a while ago. Turned out to be a bad driver. My computer has a Realtek network card and one of their older drivers causes problems.
This is the thread I started and this is where I found the solution.

/Olle
Reply
#15
(2012-03-21, 18:49)OlleDenStore Wrote: Hi!

Not sure if this helps but I had a similar problem a while ago. Turned out to be a bad driver. My computer has a Realtek network card and one of their older drivers causes problems.
This is the thread I started and this is where I found the solution.

/Olle

Thanks alot for the info. I'll look into it later, but Im pretty sure drivers are fully updated (at least when I checked last week against lenovo's auto updater), but I'll double check - would surprise me if its a driver issue tho', considering the facts discussed earlier in this thread. Wink
Reply

Logout Mark Read Team Forum Stats Members Help
Windows 7 x86 poor SMB Performance0