Andyroo

Re: number of users that can connect to raspberry 3b

Sat May 25, 2019 11:49 am

Agreed - better to stick to one box for this.

I’ve found this old thread from 2014 that has different adapter tests and some got significantly higher results.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23935
Joined: Sat Jul 30, 2011 7:41 pm

Re: number of users that can connect to raspberry 3b

Sat May 25, 2019 12:46 pm

mina wrote:
Sat May 25, 2019 10:52 am
DougieLawson wrote:
Sat May 25, 2019 8:56 am
mina wrote:
Sat May 25, 2019 8:26 am
Are you saying that each new wifi connection take so much RAM that after 25 users the RPi freezes? Interesting (I thought myself it could be a wifi driver problem.)

I'll try to do some tests to see wether your assertion holds.
No, I'm saying you need to measure the base RAM usage when the system is booted and ready for use. Measure how much it increases for 1, 2, 5, 10, 15, 20 connected users. Then do some scrap paper maths to workout where the theoretical limit will be. Then do an empirical test to see how many users flood the system. You're aiming for 95% cpu busy on four cores and approx 67% RAM committed as the practical limits.
I think you don't understand the use case: the device serves as a wifi AP and a web server, that's all. No user is logged in the RPi in production use.

Nginx and php-fpm are optimized so that memory is not a problem. Flooding the web server using ApacheBench shows that memory is not a problem: available memory remains at around 600M at any time, even with 100 concurrent http requests! Swap is never used.

The limitation I experience is uniquely caused by concurrent wifi connections to the AP (hostapd), and that's the reason I'm suspecting it's a wifi driver issue.

I'd be glad for any suggestion.
That the sort of information I was wondering about. There could be some sort of limit in the wireless SW somewhere, but I have not seen anything. It would be worth adding an issue to our github tracker to report this officially, otherwise it will get lost.
If anyone is interested, do a search on `brcmfmac max connections`, there might be some help in there.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Sat May 25, 2019 12:53 pm

jamesh wrote:
Sat May 25, 2019 12:46 pm
That the sort of information I was wondering about. There could be some sort of limit in the wireless SW somewhere, but I have not seen anything. It would be worth adding an issue to our github tracker to report this officially, otherwise it will get lost.
If anyone is interested, do a search on `brcmfmac max connections`, there might be some help in there.
Will do with pleasure. Can you point me to the correct repo?
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

User avatar
DougieLawson
Posts: 36327
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: number of users that can connect to raspberry 3b

Sat May 25, 2019 12:54 pm

I completely understand your use case. You just aren't grasping what I've said. The bottleneck may or may not be in a service on the Raspberry Pi.

If it's hostapd (which equally has a RAM requirement for each connected user) which creates a bottleneck then fix that with an external access point. [Curiously, CISCO, DLINK & TP-LINK make kit that can handle hundreds of users - my access point easily works with 36 dhcp client machines.]

This stuff isn't hard, we've been doing this with mainframes for 50+ years.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Sat May 25, 2019 1:15 pm

DougieLawson wrote:
Sat May 25, 2019 12:54 pm
I completely understand your use case. You just aren't grasping what I've said. The bottleneck may or may not be in a service on the Raspberry Pi.

If it's hostapd (which equally has a RAM requirement for each connected user) which creates a bottleneck then fix that with an external access point. [Curiously, CISCO, DLINK & TP-LINK make kit that can handle hundreds of users - my access point easily works with 36 dhcp client machines.]

This stuff isn't hard, we've been doing this with mainframes for 50+ years.
You're right it would be easier this way.

But my use case needs to use the RPi as a all-in-one standalone device. So any external AP (just like any wireless adaptor) is out of scope for this project. If you want to know why, have a look here: https://moodlebox.net/en/help/what-is-the-moodlebox/.
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

Ernst
Posts: 1247
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: number of users that can connect to raspberry 3b

Sat May 25, 2019 2:10 pm

mina wrote:
Sat May 25, 2019 1:15 pm
But my use case needs to use the RPi as a all-in-one standalone device. So any external AP (just like any wireless adaptor) is out of scope for this project. If you want to know why, have a look here: https://moodlebox.net/en/help/what-is-the-moodlebox/.
I have been testing the RPi3B as Access Point (hostapd) some time ago, the maximum number of clients I was able to serve was 11 using an older 4.14.34 kernel on a test installation. My tests using newer releases were not successful and I dropped the idea to have an AP on my NAS/Web server.

Reading this thread, doing a few searches, reading on my own thread I noticed a few things:
- My initial AP installation using 14.4.38 on the NAS/Web server was used with 3 Android clients
- My test AP installation using 14.4.50 on the NAS/Web server failed with 3 Android clients
- My test AP using 14.4.50 on dedicated P3B failed with a varying number of android / windows / raspbian clients
- My test AP using 14.4.38 on dedicated P3B worked successfully with a varying number of android / windows / raspbian clients
- My NAS/Web server AP using 14.4.38 failed with a varying number of android / windows / raspbian clients

I suspect that the newer kernels introduced something that hinders hostaps performing as expected in combination with the brcmfmac driver with a larger number of connected devices involving a mixture of operating systems.
Somewhere I found a hint that the maximum number of connections could be 8, but I was able to connect 11 and there is a thread where 14 connections were used. (viewtopic.php?t=210147)

On my NAS/Web server (RPi3b) I am hosting a MySQL database, Apache with several sites, Samba serving 2TB, NFS service 300GB, cron jobs to gather information and perform downloads. Take this into account it may explain why I was unable to use this RPi as an AP evenso the test installation worked successfully with the same kernel version.
(please note that I setup the AP because I can, not because I needed it).

The way I see it at the moment is that there is no clear answer how many clients a RPi3 server with Access Point will (reliably) support because every software configuration is different and it is difficult to get enough clients (and time) together to do proper POC (proof of concept) testing.
The road to insanity is paved with static ip addresses

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Tue Jun 11, 2019 3:35 pm

mina wrote:
Sat May 25, 2019 12:53 pm
jamesh wrote:
Sat May 25, 2019 12:46 pm
That the sort of information I was wondering about. There could be some sort of limit in the wireless SW somewhere, but I have not seen anything. It would be worth adding an issue to our github tracker to report this officially, otherwise it will get lost.
If anyone is interested, do a search on `brcmfmac max connections`, there might be some help in there.
Will do with pleasure. Can you point me to the correct repo?
@Jamesh: In what repos should I open an issue for this related problem?
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23935
Joined: Sat Jul 30, 2011 7:41 pm

Re: number of users that can connect to raspberry 3b

Tue Jun 11, 2019 3:58 pm

mina wrote:
Tue Jun 11, 2019 3:35 pm
mina wrote:
Sat May 25, 2019 12:53 pm
jamesh wrote:
Sat May 25, 2019 12:46 pm
That the sort of information I was wondering about. There could be some sort of limit in the wireless SW somewhere, but I have not seen anything. It would be worth adding an issue to our github tracker to report this officially, otherwise it will get lost.
If anyone is interested, do a search on `brcmfmac max connections`, there might be some help in there.
Will do with pleasure. Can you point me to the correct repo?
@Jamesh: In what repos should I open an issue for this related problem?
https://github.com/raspberrypi/linux
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Tue Jun 11, 2019 7:19 pm

Maintainer of MoodleBox, a Moodle server on Raspberry Pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23935
Joined: Sat Jul 30, 2011 7:41 pm

Re: number of users that can connect to raspberry 3b

Tue Jun 11, 2019 8:20 pm

mina wrote:
Tue Jun 11, 2019 7:19 pm
Thank you Jamesh.

Done: https://github.com/raspberrypi/linux/issues/3010.
Thanks. Cannot promise we can look at it right away, but it now won't be forgotten.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Wed Jul 31, 2019 4:41 pm

jamesh wrote:
Tue Jun 11, 2019 8:20 pm
Cannot promise we can look at it right away, but it now won't be forgotten.
Any news?
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Fri Oct 11, 2019 3:16 pm

Bump. Hopefully this will not be forgotten.
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23935
Joined: Sat Jul 30, 2011 7:41 pm

Re: number of users that can connect to raspberry 3b

Fri Oct 11, 2019 3:37 pm

No news. I've not had time to look at it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

ejolson
Posts: 3724
Joined: Tue Mar 18, 2014 11:47 am

Re: number of users that can connect to raspberry 3b

Fri Oct 11, 2019 6:35 pm

mina wrote:
Fri Oct 11, 2019 3:16 pm
Bump. Hopefully this will not be forgotten.
What happens if you swap out the Pi 3 for a 4B with 4GB memory?

Knowing whether the 4B can support significantly more users might provide a clue to tracking down what is going on with the earlier model. Unfortunately, I can't help as I don't have more than a handful of devices that can connect to WiFi for testing.

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Fri Oct 11, 2019 7:01 pm

ejolson wrote:
Fri Oct 11, 2019 6:35 pm
What happens if you swap out the Pi 3 for a 4B with 4GB memory?
Unfortunately, it doesn't change anything :-(. To summary, same issue on RPi 3B, 3B+ and 4B.
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

ejolson
Posts: 3724
Joined: Tue Mar 18, 2014 11:47 am

Re: number of users that can connect to raspberry 3b

Sun Oct 13, 2019 5:02 pm

mina wrote:
Fri Oct 11, 2019 7:01 pm
ejolson wrote:
Fri Oct 11, 2019 6:35 pm
What happens if you swap out the Pi 3 for a 4B with 4GB memory?
Unfortunately, it doesn't change anything :-(. To summary, same issue on RPi 3B, 3B+ and 4B.
It seems like a hardware or hard-coded limit on the number of simultaneous sessions that can associate to the Pi WiFi device when used as an access point. Have you tried reading the comments in the Linux driver source code to see whether any configurable limits exist and whether the hardware has other limits?

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Sun Oct 13, 2019 5:08 pm

ejolson wrote:
Sun Oct 13, 2019 5:02 pm
Have you tried reading the comments in the Linux driver source code to see whether any configurable limits exist and whether the hardware has other limits?
I'm afraid not, since I can't code Linux driver :-/. But Jamesh has doubt that the problem is a limit in the code.
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

ejolson
Posts: 3724
Joined: Tue Mar 18, 2014 11:47 am

Re: number of users that can connect to raspberry 3b

Sun Oct 13, 2019 6:17 pm

mina wrote:
Sun Oct 13, 2019 5:08 pm
ejolson wrote:
Sun Oct 13, 2019 5:02 pm
Have you tried reading the comments in the Linux driver source code to see whether any configurable limits exist and whether the hardware has other limits?
I'm afraid not, since I can't code Linux driver :-/. But Jamesh has doubt that the problem is a limit in the code.
Even without knowing how to write a program, I think quite a bit could be understood from reading the comments in the driver code and would encourage you to try and do so.

mina
Posts: 28
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: number of users that can connect to raspberry 3b

Sun Oct 13, 2019 6:20 pm

ejolson wrote:
Sun Oct 13, 2019 6:17 pm
Even without knowing how to write a program, I think quite a bit about the problem could be understood from reading the comments in the driver code and would encourage you to try and do so.
Yes, you're probably right. Would you mind give me a hint where to start? (Where in the source code should I begin to search?)
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

Return to “General discussion”