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: 26847
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.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

mina
Posts: 30
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: 39562
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest 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: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

mina
Posts: 30
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: 1337
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: 30
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: 26847
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.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

mina
Posts: 30
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: 26847
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.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

mina
Posts: 30
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: 30
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: 26847
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.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ejolson
Posts: 5591
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: 30
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: 5591
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: 30
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: 5591
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: 30
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

Lrosalba
Posts: 1
Joined: Thu Mar 12, 2020 7:07 pm

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

Thu Mar 12, 2020 7:49 pm

I bought myself a wi-fi router ,connected to eth0 and configured my Rpi to disable the wlan0 expecting to avoid the limitation of 30 users. All other devices(smartphones etc.) communicate throught the router dns. I've been experiencing high lags for login (maybe because i havent configured ssl yet...) But after login All runs fine. I Will try to perform a more than 30 users concurrent acess. Anyone have ever tryied something similar ?? Sorry for typos im on my phone...

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

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

Sun Jun 07, 2020 5:22 pm

Kindly asking if someone had time to have a look at this?

Will 64bit Raspberry OS version give any solution?
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

mmoseeker
Posts: 9
Joined: Mon Jun 08, 2020 9:27 am

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

Tue Jun 09, 2020 12:59 am

buy a Pi 3B+ or CM3+ to increase the
number of users that can connect to raspberry 3b

wildfire
Posts: 641
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

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

Tue Jun 09, 2020 1:17 am

mmoseeker wrote:
Tue Jun 09, 2020 12:59 am
buy a Pi 3B+ or CM3+ to increase the
number of users that can connect to raspberry 3b
Erm, Have you even read this thread?
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

HTCpi
Posts: 6
Joined: Fri Jan 17, 2020 11:26 am

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

Tue Aug 18, 2020 12:11 pm

Just to add to the problem:
I run Moodlebox (latest image)
I understand the low number of connected users as discussed in this forum - I am happy to have 10 to 15 users, however, my issue is the change from 3B+ to 4B 2gb has resulted in just less than half the number of connections and I am confused.
Surely the same sd card in each device should allow the same number of log-ins yet when I switch the sd card between the 3 and 4, I get more users on the 3 (11 max users tried) but switch to a 4 and I get 5 users only - the 6th user causes the pi to freeze and need rebooting.
Therefore I suspect that there is some software glitch causing this fault because I think the wifi hardware is the same.
Only software changes I have made is to disable the hdmi and bluetooth in case these were causing conflict as reported in the early days of the pi 4 but no difference for me.
I run completely headless and no USB etc - official power supply too (except solar powered units but they do have a 3amp supply) - no indication that power is the issue via software notification or flashing led.
My project takes a serious hit if I can only get 5 users. (I have purchased 30 Pi 4's and don't want to downgrade to 3's)

HTCpi
Posts: 6
Joined: Fri Jan 17, 2020 11:26 am

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

Tue Aug 18, 2020 2:19 pm

As an update I have just tested a wifi range extender to see if it helps. Logic told me that a bottle neck is a bottleneck and won't be resolved by adding a range extender. My logic was wrong - I connected it and had 10 devices running videos at the same time - I ran out of devices so don't know the limit but all devices ran videos seamlessly. Previously I could only run 5 devices and the 6th caused a crash/freeze.
A solution on the Pi or software would be better, but for now a cheapish $10 range extender works.

Return to “General discussion”