Andyroo
Posts: 3255
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

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.
Need Pi spray - these things are breeding in my house...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22660
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...
"My grief counseller just died, luckily, he was so good, I didn't care."

mina
Posts: 16
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?
Nicolas – Maintainer of MoodleBox, a Moodle server on Raspberry Pi

User avatar
DougieLawson
Posts: 35340
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 remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

mina
Posts: 16
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/.
Nicolas – Maintainer of MoodleBox, a Moodle server on Raspberry Pi

Ernst
Posts: 1139
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: 16
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?
Nicolas – Maintainer of MoodleBox, a Moodle server on Raspberry Pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22660
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...
"My grief counseller just died, luckily, he was so good, I didn't care."

mina
Posts: 16
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

Nicolas – Maintainer of MoodleBox, a Moodle server on Raspberry Pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22660
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...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “General discussion”