Skip to main content
Trending Lyricist I
January 27, 2022

Sonos making thousands of SMB3 connections to Synology

  • January 27, 2022
  • 66 replies
  • 3055 views

Not sure if anyone else is experiencing issues with Sonos Music Library and the Synology NAS becoming unresponsive or very sluggish, or with random speakers disappearing from the S2 app.

 

I recently enabled the Music Library feature in Sonos (before the 13.4.1 update in Dec 2021 which introduced SMB3 support). At that time, I configured my Synology NAS to use SMB1 to allow the connection to work. I was on DSM Version: 7.0.1-42218 and running S2 13.3.2. Somewhere around 11/25/21, my Synology started going offline and become unresponsive. I was running a DS1517+ with 2GB of RAM and noticed that the SMB process was eating a lot more RAM than usual. Also, started seeing thousands of connections from the Sonos speakers, multiple times for each speaker. My Sonos updated to 13.4, but the issue still remained.

I opened a case with Synology and they determined that the Sonos speakers were opening hundreds of connections per speaker and leaving the connections open. This was slowly draining the memory until the NAS would become unresponsive.

On 12/7/21, S2 updated to 13.4.1 which introduced the SMB3 support. I turned off SMB1 on the Synology NAS and still saw the hundreds and thousands of connections. I would also see the speakers attempt an SMB1 connection still which was denied by the speakers. For testing, we tried leaving SMB1 on, but still saw the large amount of connections from the Sonos speakers.

I ended up switching to a newer DS1621+ with 8GB of RAM and the issue still continued to happen, but took several days instead of just one. At one point, the number of active connections from Sonos was near 4000.

 

After switching to the DS1621+ with more memory, the issues started getting worse on the Sonos side. Several speakers would start to show up as ZP100 (would be various speakers and not always the same ones). This marked these speakers as incompatible with the S2 app and so I couldn’t do anything relating to the music library (like remove it) until the affected speakers were rebooted. If you tried going to http://<ip of speaker>:1400/xml/device_information.xml nothing would show up, or just the XML banner stating “This XML file does not appear to have any style information associated with it. The document tree is shown below.” The speakers were acting similar to the old NAS where they would start to become unresponsive. I can only guess that with the hundreds of open connections to the NAS, the memory utilization would get very high and the speaker would stop responding correctly.

 

After rebooting the speaker that showed up as a ZP100 you could then hit the XML page and the speaker showed up correctly as a Sonos One. I would also get some speakers that would just completely drop from the application, but after a reboot, they’d show up just fine.. In all cases, my wireless controller showed all speakers connected on the network and they all responded to pings. After a reboot of all the speakers, they all showed up correctly in the S2 app and could all play music from the Synology. Also, after a reboot of the speaker, all the connections would slowly drop on the NAS and memory usage would return to normal.
 

The whole system would run fine for a couple of days and then the connections would start appearing on the NAS at various times (not just at the 2am re-indexing time). I also noticed that whenever I had the S2 app up and when I would explore a Sonos playlist that contained music from the NAS, I would get SMB1 failures in the NAS logs for the associated speaker. I believe that the code is still set to use SMB1 for some functions and is getting blocked by the NAS..

 

If I disable the Music Library, all the speakers stay connected to the wifi network and I can stream music with no issues for several days. The memory on the NAS remains at normal levels and doesn’t climb over time. I still see SMB1 connections whenever I pull up the S2 app as long as the Sonos playlists exist that point to music on the NAS, even if the Muisc Library is disabled. I still think the Sonos code is trying to use SMB1 to update something either with album art or the track icons and is having trouble. If I browse to the album directly under Music Library, the album art does show correctly. It just seems to be the track icons in the playlist has trouble populating. These playlists were created by selecting various tracks in the Music Library and adding them to the Sonos playlist.

 

I have tickets open with both Synology and Sonos and currently waiting to hear back from Sonos after giving them countless diagnostics and logs. It seems that the diagnostic logs don’t show the connections to the NAS and so support doesn’t have any visibility into the problem other than looking at the thousands of connections in the Synology logs that I’m providing them.

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

66 replies

ChewbuckaAuthor
Trending Lyricist I
January 29, 2022

Jut received word from support that they believe they have the root cause identified and are working on a fix. I’ll let you know once the fix is out and if it resolves the issue.

Trending Lyricist I
February 23, 2022

I had noticed exactly the same thing here:

 

 

 

 

Basically, over time,  the newer firmware leaves orphaned connections to the NAS that are not cleaned up. Eventually you will run out of connections or memory.  Scrolling around and fiddling with the S2 app seems to make the problem worse.

 

I tried to work with support but they were not helpful. I’m pretty amazed that nobody else has complained much about this problem, since it can overwhelm the NAS. I guess maybe people don’t update the firmware that much - I never had the problem until December when I was forced to update due to purchasing an addition. Also its possible that some NAS’s are set up to timeout connections (see below...)

 

What I’ve done to help the problem is to set “deadtime” parameter in the [global] section of the NAS smb.conf to around 3 days. This will time out the orphaned connections -- I run with about 200 connections now since there are always going to be some dead ones  -- there should normally only be 5 or so connections I think.  You could drop deadtime lower but then if you have other devices or windows workstations using the NAS they may have to reopen connections.

 

The other parameter you could set is the max connections setting in the sections for the specific shares. I set mine to 500 which gives me enough room, considering the extent of this bug :-)

 

Some NASs may do this already, and others may have a UI to change these values, but my old NAS doesn’t so I need to edit the smb.conf

 

My main music library is on a single share called Music. If I look at the connections now I have 186 connections!

 

root@ix4-300d:/opt# /usr/local/samba/bin/smbstatus | grep Music | wc -l
186

It would be much higher (until memory ran out) if I didn’t set deadtime.

 

 

You can clearly see I have connections left over from Sunday (which are about to be cleaned up since they are almost 3 days old)

root@ix4-300d:/opt# /usr/local/samba/bin/smbstatus | grep Sun
Music        30681   192.168.1.113 Sun Feb 20 06:26:48 PM 2022 EST  -            -
Music        27294   192.168.1.139 Sun Feb 20 05:42:33 PM 2022 EST  -            -
Music        24291   192.168.1.139 Sun Feb 20 05:10:20 PM 2022 EST  -            -
Music        29298   192.168.1.168 Sun Feb 20 06:10:22 PM 2022 EST  -            -

…. (and many more).

These are all SMB3 connections btw, such as:

1688    nobody       users        192.168.1.139 (ipv4:192.168.1.139:33922)  SMB3_02           -                    -

 

 

Again, I’m not sure how most people cope with this level of connections. Maybe the problem only expresses itself  in certain configurations. Maybe nobody uses the music library anymore…..  I couldn’t convince support to figure it out with me :-)

 

 

 

 

 

controlav
Lead Maestro
February 23, 2022

Have you tried a 3rd party app? Such as SonoPhone or mine for Windows?

Author of the leading independent Sonos apps for Android, MacOS, iOS, Windows and Xbox.
ChewbuckaAuthor
Trending Lyricist I
February 24, 2022

Update 14.2 was released yesterday. I’ve re-enabled my music library to my NAS and will monitor for the next day or so to see if the connections continue.

Something else I’ve noticed, is that if you have any playlists created that contain music from your NAS, even if you don’t have the music library feature enabled, Sonos will still make SMB connections to the NAS. I’m assuming it’s to grab artwork for the songs in the playlist. I’ve also noticed that Sonos uses SMB1 connections first and then falls back to SMB3 which seems backwards to me. It should try the more secure method first and only fallback to SMB1 if it can’t connect via SMB3.

ChewbuckaAuthor
Trending Lyricist I
February 24, 2022

What I’ve done to help the problem is to set “deadtime” parameter in the [global] section of the NAS smb.conf to around 3 days. This will time out the orphaned connections -- I run with about 200 connections now since there are always going to be some dead ones  -- there should normally only be 5 or so connections I think.  You could drop deadtime lower but then if you have other devices or windows workstations using the NAS they may have to reopen connections.

 

The other parameter you could set is the max connections setting in the sections for the specific shares. I set mine to 500 which gives me enough room, considering the extent of this bug :-)

 

Some NASs may do this already, and others may have a UI to change these values, but my old NAS doesn’t so I need to edit the smb.conf

 

 

 

 

On Synology, there is a setting to allow only one SMB connection per IP address. This definitely prevents the issue from happening, however, when you go to play songs from the NAS, the initial song will fail to play, but then subsequent songs will play without issue. If development can’t figure out how to keep the speakers from making hundreds of calls to the NAS, I may just end up turning on the single connection option on the Synology and be done with it.

I also think the number of connections to the NAS may be related to the number of songs you have in your library. I’m thinking the more songs you have, the more connections that are made and so might affect people differently depending upon the number of songs in the library.

Trending Lyricist I
February 24, 2022

If I switch the Sonos to a dhcp reservation and put that in “hosts allow”, I still have to contend with some other non-Sonos devices connecting to the same shares. I don’t see anyway to limit the connection count per ip address, at least in the smb.conf. I could set max connections really low but don’t want to limit other well-behaved clients.

 

ChewbuckaAuthor
Trending Lyricist I
February 24, 2022

Update 14.2 was released yesterday. I’ve re-enabled my music library to my NAS and will monitor for the next day or so to see if the connections continue.

Something else I’ve noticed, is that if you have any playlists created that contain music from your NAS, even if you don’t have the music library feature enabled, Sonos will still make SMB connections to the NAS. I’m assuming it’s to grab artwork for the songs in the playlist. I’ve also noticed that Sonos uses SMB1 connections first and then falls back to SMB3 which seems backwards to me. It should try the more secure method first and only fallback to SMB1 if it can’t connect via SMB3.

A slight correction to the above, Sonos doesn’t consistently make SMB1 connections. I just tested browsing playlists after adding the music library back, and only see SMB3 connections. I’m not sure what actions are triggering the SMB1 connections to the NAS at this time. I can just see that there are failed attempts from the speakers because I have SMB1 disabled.

ChewbuckaAuthor
Trending Lyricist I
February 24, 2022

If I switch the Sonos to a dhcp reservation and put that in “hosts allow”, I still have to contend with some other non-Sonos devices connecting to the same shares. I don’t see anyway to limit the connection count per ip address, at least in the smb.conf. I could set max connections really low but don’t want to limit other well-behaved clients.

 

I have several SMB shares on my NAS as well and several Windows clients are connecting to them. My experience has been that each of these Windows machines only has one connection open to the NAS at a time. I’m assuming that “well behaved” clients only make a single connection to the SMB share and so limiting SMB to a single connection per IP shouldn’t break those clients. I agree with you though, we shouldn’t have to enable such strict measures just for the Sonos speakers.

ChewbuckaAuthor
Trending Lyricist I
February 24, 2022

BTW, I don’t believe I’ve noticed this behavior until sometime around the release of 13.4 back in November. I had the music library enabled since Halloween to play songs on the Sonos speakers and it was working fine until about Thanksgiving. That’s when I noticed my NAS starting to hang and go offline and I opened a ticket with Synology and that’s when we discovered the thousands of connections from the Sonos speakers.

My old NAS had 2GB of RAM and would lock up after a day or 2. I recently replaced that older NAS with one that has 8GB of RAM and it lasts a lot longer before becoming unresponsive. Most of the time, the Sonos speakers will start to crash first before the NAS does since the speakers don’t have enough RAM to maintain the high number of SMB connections to the NAS.

Trending Lyricist I
February 25, 2022

Definitely not fixed in 14.2.